owlapi v3 vs v5

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

owlapi v3 vs v5

ianh
Hi all,

The following code works fine using  owlapi-distribution-3.5.4.jar:

                //OWLOntology ontology, OWLOntologyManager manager, OWLDataFactory
factory,
                //OWLClass concept, OWLObjectProperty role
               
        Set<OWLObjectPropertyExpression> subRoles =
role.getSubProperties(ontology);
        for (OWLObjectPropertyExpression subRole : subRoles) {
        //process sub role
        }
               
        Set<OWLClassExpression> subClasses =
concept.getSubClasses(ontology);        
    for (OWLClassExpression subClass : subClasses) {
            //process sub concept
    }

But when moving to Eclipse Maven with v5.1.11:

        <dependencies>
        <dependency>
                        <groupId>edu.stanford.protege</groupId>
            <artifactId>protege-editor-owl</artifactId>
                        <version>5.0.0</version>
        </dependency>
        <dependency>
        <groupId>net.sourceforge.owlapi</groupId>
        <artifactId>owlapi-distribution</artifactId>
        <version>5.1.11</version>
        </dependency>
        </dependencies>

I get the following two compile time errors:

   The method getSubProperties(OWLOntology) is undefined for the type
OWLObjectProperty
   The method getSubClasses(OWLOntology) is undefined for the type OWLClass

I can perform the same functionality using a reasoner, but performance is
too poor on large ontologies like Snomed:

   NodeSet<OWLClass> subConceptsNodeSet = reasoner.getSubClasses(concept,
false);
    Set<OWLClass> subConcepts = subConceptsNodeSet.getFlattened();
                   
    NodeSet<OWLObjectPropertyExpression> subRolesNodeSet =
reasoner.getSubObjectProperties(role, false);
   Set<OWLObjectPropertyExpression> subRoles =
subRolesNodeSet.getFlattened();


Any suggestion appreciated re: getting getSubProperties/getSubClasses
working with v5.5.11.


Many thanks,

Ian.



--
Sent from: http://protege-project.136.n4.nabble.com/Protege-Developer-f4659816.html
_______________________________________________
protege-dev mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-dev
Reply | Threaded
Open this post in threaded view
|

Re: owlapi v3 vs v5

Lorenz Buehmann
Protege is based on OWL API 4

On 24.09.19 12:00, ianh wrote:

> Hi all,
>
> The following code works fine using  owlapi-distribution-3.5.4.jar:
>
> //OWLOntology ontology, OWLOntologyManager manager, OWLDataFactory
> factory,
>                 //OWLClass concept, OWLObjectProperty role
>
>         Set<OWLObjectPropertyExpression> subRoles =
> role.getSubProperties(ontology);
>         for (OWLObjectPropertyExpression subRole : subRoles) {
>         //process sub role
>         }
>
>         Set<OWLClassExpression> subClasses =
> concept.getSubClasses(ontology);        
>     for (OWLClassExpression subClass : subClasses) {
>             //process sub concept
>     }
>
> But when moving to Eclipse Maven with v5.1.11:
>
> <dependencies>
>         <dependency>
> <groupId>edu.stanford.protege</groupId>
>             <artifactId>protege-editor-owl</artifactId>
> <version>5.0.0</version>
>         </dependency>
>         <dependency>
>         <groupId>net.sourceforge.owlapi</groupId>
>         <artifactId>owlapi-distribution</artifactId>
>         <version>5.1.11</version>
>         </dependency>
> </dependencies>
>
> I get the following two compile time errors:
>
>    The method getSubProperties(OWLOntology) is undefined for the type
> OWLObjectProperty
>    The method getSubClasses(OWLOntology) is undefined for the type OWLClass
>
> I can perform the same functionality using a reasoner, but performance is
> too poor on large ontologies like Snomed:
>
>    NodeSet<OWLClass> subConceptsNodeSet = reasoner.getSubClasses(concept,
> false);
>     Set<OWLClass> subConcepts = subConceptsNodeSet.getFlattened();
>    
>     NodeSet<OWLObjectPropertyExpression> subRolesNodeSet =
> reasoner.getSubObjectProperties(role, false);
>    Set<OWLObjectPropertyExpression> subRoles =
> subRolesNodeSet.getFlattened();
>
>
> Any suggestion appreciated re: getting getSubProperties/getSubClasses
> working with v5.5.11.
>
>
> Many thanks,
>
> Ian.
>
>
>
> --
> Sent from: http://protege-project.136.n4.nabble.com/Protege-Developer-f4659816.html
> _______________________________________________
> protege-dev mailing list
> [hidden email]
> https://mailman.stanford.edu/mailman/listinfo/protege-dev
_______________________________________________
protege-dev mailing list
[hidden email]
https://mailman.stanford.edu/mailman/listinfo/protege-dev