Search Mailing List Archives


Limit search to: Subject & Body Subject Author
Sort by: Reverse Sort
Limit to: All This Week Last Week This Month Last Month
Select Date Range     through    

[protege-owl] Getting the data type of a property range

Reeves, Russell russell.reeves at scra.org
Thu Apr 26 14:36:49 PDT 2007


Here's what worked:

for (Iterator pit = onc.getAssociatedProperties().iterator(); pit.hasNext();) {
	OWLProperty op = (OWLProperty) pit.next();
	if (op.isObjectProperty()) {
		RDFResource rdfr = op.getRange();
		rdfr.getBrowserText();
		System.out.println(rdfr.getBrowserText());
	} else { // it must be a datatype property
		RDFSDatatype rdfsd = op.getRangeDatatype();
		System.out.println(rdfsd.getLocalName());
	}
}
-----Original Message-----
From: protege-owl-bounces at mailman.stanford.edu [mailto:protege-owl-bounces at mailman.stanford.edu] On Behalf Of Thomas Russ
Sent: Thursday, April 26, 2007 2:51 PM
To: User support for the Protege-OWL editor
Subject: Re: [protege-owl] Getting the data type of a property range


On Apr 26, 2007, at 10:43 AM, Reeves, Russell wrote:

> I'm using the protégé-owl api and am having no problems getting the  
> collection of a class' properties.
>
> I can even get a property by name.
>
> What I can't seem to figure out is how to get the data type of the  
> range (e.g. xsd:Date). I manage to get a SimpleInstance but don't  
> know where to go from there.
>
> Anyone have a code snippet?
Perhaps one of these?

RDFProperty.getRange
   or
RDFProperty.getRangeDatatype


_______________________________________________
protege-owl mailing list
protege-owl at lists.stanford.edu
https://mailman.stanford.edu/mailman/listinfo/protege-owl

Instructions for unsubscribing: http://protege.stanford.edu/doc/faq.html#01a.03 



More information about the protege-owl mailing list