如何确定Jena中某个类的对象属性限制。对象属性限制 - jena
我一直在试图确定的,如果一个类有一个对象的限制,通过使用这样的事情:
if (essaClasse.isRestriction())
{
System.out.println("Restriction on property " +
essaClasse.asRestriction().getOnProperty());
}
else
{
System.out.println("There is not restriction" );
}
但我得到了:“没有限制”
OWL文件有一个类(的usermodel),它具有以下限制:
<owl:Class rdf:about="&geosim2;UserModel">
<rdfs:label xml:lang="en">UserModel</rdfs:label>
<rdfs:subClassOf rdf:resource="&geosim2;Model"/>
<rdfs:subClassOf>
<owl:Restriction>
<owl:onProperty rdf:resource="&geosim2;hasPeople"/>
<owl:minCardinality rdf:datatype="&xsd;nonNegativeInteger">1</owl:minCardinality>
</owl:Restriction>
</rdfs:subClassOf>
<rdfs:subClassOf>
<owl:Restriction>
<owl:onProperty rdf:resource="&geosim2;hasPhysicalPlace"/>
<owl:minCardinality rdf:datatype="&xsd;nonNegativeInteger">1</owl:minCardinality>
</owl:Restriction>
</rdfs:subClassOf>
<rdfs:isDefinedBy rdf:datatype="&xsd;string">http://dit.upm.es/~perez/geosim/0.1.3/ns.owl#</rdfs:isDefinedBy>
<rdfs:comment xml:lang="en">An instance of this class models a user simulation model.</rdfs:comment>
</owl:Class>
怎么你的代码中设置essaClasse? – AndyS