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-dev] How to display the "property" on webprotege

Matthew Horridge matthew.horridge at stanford.edu
Tue May 12 09:56:23 PDT 2015


Hi,

It’s almost right, but you have used an AllValuesFromRestriction instead of a SomeValuesFromRestriction.  If you use a SomeValuesFromRestriction then WebProtege will display the property as you want.

Cheers,

Matthew


> On 12 May 2015, at 08:26, mywbob <mywbob at gmail.com> wrote:
> 
> Thank you Matthew. I tried your solution but it does not work...
> 
> Here is the file that I generated(I also edit something by hand..)
> 
> 
> file1:
> 
> 
> 
>    <DatatypeProperty rdf:about="http://what/ever/row">
>        <rdfs:label>row</rdfs:label>
>    </DatatypeProperty>
> 
> 
> 
> 
>    <Class rdf:about="http://what/ever/athing">
>        <rdfs:label>athing</rdfs:label>
>        <rdfs:subClassOf
> rdf:resource="http://www.w3.org/2002/07/owl#Thing"/>
>        <rdfs:subClassOf>
>            <Restriction>
>                <onProperty rdf:resource="http://what/ever/row"/>
>                <allValuesFrom
> rdf:resource="http://www.w3.org/2001/XMLSchema#string"/>
>            </Restriction>
>        </rdfs:subClassOf>
>    </Class>
> 
> however, it does not work..
> 
> below is the java code I used...
> public static OntModel createModel() throws Exception {
> 		String NS = "http://what/ever/";
> 		jenaModel = ModelFactory.createOntologyModel(OntModelSpec.OWL_DL_MEM);
> 
> 
> 		OntClass athing = jenaModel.createClass(NS + "athing");
> 		athing.addLabel("athing", null);
> 		
> 		
> 		String NNNS ="http://www.w3.org/2002/07/owl#";
> 		Resource r1 = ResourceFactory.createResource(NNNS + "Thing");
> 		
> 		athing.addSuperClass(r1);
> 
> 		//data property
> 		DatatypeProperty row = jenaModel.createDatatypeProperty(NS + "row");
> 		row.addLabel("row", null);//lang is null, label is row
> 
> 
> 		String NNS = "http://www.w3.org/2001/XMLSchema#";
> 		
> 		Resource r = ResourceFactory.createResource(NNS + "string");
> 		Property p = ResourceFactory.createProperty(NS + "bb");
> 		
> 		AllValuesFromRestriction avf1 =
> jenaModel.createAllValuesFromRestriction(null, p, r);
> 		avf1.addSubClass(athing);
> 
> 		return jenaModel;
> 	}
> 
> I tried to replace "p" in "jenaModel.createAllValuesFromRestriction(null, p,
> r);" with "row". but the generated file looked like:
> 
>  <owl:Class rdf:about="http://what/ever/athing">
>    <rdfs:subClassOf>
>      <owl:Restriction>
>        <owl:allValuesFrom
> rdf:resource="http://www.w3.org/2001/XMLSchema#string"/>
>        <owl:onProperty> (this part looks wired to me)
>          <owl:DatatypeProperty rdf:about="http://what/ever/row"/>
>        </owl:onProperty>
>      </owl:Restriction>
>    </rdfs:subClassOf>
>    <rdfs:subClassOf rdf:resource="http://www.w3.org/2002/07/owl#Thing"/>
>    <rdfs:label>athing</rdfs:label>
>  </owl:Class>
> 
> The thing in owl:onProperty tag looks weird, so I used "p".  
> The owl:onProperty tag is <onProperty rdf:resource="http://what/ever/bb"/>
> if i do so. So I change
> <onProperty rdf:resource="http://what/ever/bb"/> to <onProperty
> rdf:resource="http://what/ever/row"/> by hand.
> 
> 
> The file can be upload to webprotege, However, the "row" cannot be displayed
> under the property section...
> 
> 
> 
> 
> 
> --
> View this message in context: http://protege-project.136.n4.nabble.com/How-to-display-the-property-on-webprotege-tp4662927p4662934.html
> Sent from the Protege Developer mailing list archive at Nabble.com.
> _______________________________________________
> protege-dev mailing list
> protege-dev at lists.stanford.edu
> https://mailman.stanford.edu/mailman/listinfo/protege-dev




More information about the protege-dev mailing list