How to get ObjectPropertyChain from owl file in JAVA program?

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

How to get ObjectPropertyChain from owl file in JAVA program?

YP Protege
This post was updated on .
Hi all,
I add some objectPropertyChain in Protege 4.3.


Now, I want to get it with OWL2 in java program,

File ontoFile = new File(filepath);
OWLOntologyManager manager = OWLManager.createOWLOntologyManager();
OWLOntology ontology = manager.loadOntologyFromOntologyDocument(ontoFile);
Set<OWLObjectProperty> owlObjectProperties = ontology.getObjectPropertiesInSignature();
Iterator<OWLObjectProperty> iterator = owlObjectProperties.iterator();
while(iterator.hasNext()){
    String chains = "";
    Set<OWLObjectPropertyExpression> chainSet = objectProperty.getSuperProperties(ontology);
    Iterator<OWLObjectPropertyExpression> iterator6 = chainSet.iterator();
                               
        while(iterator6.hasNext()){
                OWLObjectPropertyExpression  chain = iterator6.next();
                        if(chains != ""){
                                chains = chains+",";
                        }
                        String chainTemp = chain.getSignature().toString();
                        chains = chains + method.getOWLName(chainTemp);
        }
        System.out.println("chains: "+chains);
}

But the console print "chains :",and there is a WARNING:com.clarkparsia.pellet.owlapiv3.PelletVisitor addUnsupportedAxiom   Ignoring unsupported axiom: SubObjectPropertyOf(ObjectPropertyChain( <http://www.semanticweb.org/yp/ontologies/2016/0/MyTolerance#has_ARC> <http://www.semanticweb.org/yp/ontologies/2016/0/MyTolerance#has_COI> <http://www.semanticweb.org/yp/ontologies/2016/0/MyTolerance#has_DIS> ) <http://www.semanticweb.org/yp/ontologies/2016/0/MyTolerance#has_Angle>)

How can I get the chain? It's the problem of jar?

Thanks,
Best regards.
Reply | Threaded
Open this post in threaded view
|

Re: How to get ObjectPropertyChain from owl file in JAVA program?

Lorenz Buehmann
The chain is the subproperty expression.

> Hi all,
> I add some objectPropertyChain in Protege 4.3.
> <http://protege-project.136.n4.nabble.com/file/n4664951/Image_10.png>
>
> Now, I want to get it with OWL2 in java program,
>
> File ontoFile = new File(filepath);
> OWLOntologyManager manager = OWLManager.createOWLOntologyManager();
> OWLOntology ontology = manager.loadOntologyFromOntologyDocument(ontoFile);
> Set<OWLObjectProperty> owlObjectProperties =
> ontology.getObjectPropertiesInSignature();
> Iterator<OWLObjectProperty> iterator = owlObjectProperties.iterator();
> while(iterator.hasNext()){
>      String chains = "";
>      Set<OWLObjectPropertyExpression> chainSet =
> objectProperty.getSuperProperties(ontology);
>      Iterator<OWLObjectPropertyExpression> iterator6 = chainSet.iterator();
>
> while(iterator6.hasNext()){
> OWLObjectPropertyExpression  chain = iterator6.next();
> if(chains != ""){
> chains = chains+",";
> }
> String chainTemp = chain.getSignature().toString();
> chains = chains + method.getOWLName(chainTemp);
> }
> System.out.println("chains: "+chains);
> }
>
> But the console print "chains :",and there is a
> WARNING:com.clarkparsia.pellet.owlapiv3.PelletVisitor addUnsupportedAxiom
> Ignoring unsupported axiom: SubObjectPropertyOf(ObjectPropertyChain(
> <http://www.semanticweb.org/yp/ontologies/2016/0/MyTolerance#has_ARC>
> <http://www.semanticweb.org/yp/ontologies/2016/0/MyTolerance#has_COI>
> <http://www.semanticweb.org/yp/ontologies/2016/0/MyTolerance#has_DIS> )
> <http://www.semanticweb.org/yp/ontologies/2016/0/MyTolerance#has_Angle>)
>
> How can I get the chain? It's the problem of jar?
>
> Thanks,
> Best regards.
>
>
>
> --
> View this message in context: http://protege-project.136.n4.nabble.com/How-to-get-ObjectPropertyChain-from-owl-file-in-JAVA-program-tp4664951.html
> Sent from the Protege User mailing list archive at Nabble.com.
> _______________________________________________
> protege-user mailing list
> [hidden email]
> https://mailman.stanford.edu/mailman/listinfo/protege-user

--
Lorenz B├╝hmann
AKSW group, University of Leipzig
Group: http://aksw.org - semantic web research center

_______________________________________________
protege-user mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-user