protege | source ontology editor that supports the latest OWL | Data Manipulation library

 by   protegeproject Java Version: protege-parent-5.6.1 License: Non-SPDX

kandi X-RAY | protege Summary

protege is a Java library typically used in Utilities, Data Manipulation applications. protege has no bugs, it has no vulnerabilities, it has build file available and it has high support. However protege has a Non-SPDX License. You can download it from GitHub, Maven.
Protege is a free, open-source ontology editor that supports the latest OWL 2.0 standard. Protege has a pluggable architecture, and many plugins for different functionalities are available. To read more about Protege's features, please visit the Protege home page. The latest version of Protege can be downloaded from the Protege website, or from github. If you would like to contribute to the Protege Project please see our contributing guide. The Developer Documentation may be found on the wiki. Looking for support? Please ask questions on the protege-user or protege-dev mailing lists. If you found a bug or would like to request a feature, you may also use this issue tracker. Protege is released under the BSD 2-clause license. Instructions for building from source are available on the the wiki.
    Support
      Quality
        Security
          License
            Reuse
            Support
              Quality
                Security
                  License
                    Reuse

                      kandi-support Support

                        summary
                        protege has a highly active ecosystem.
                        summary
                        It has 825 star(s) with 224 fork(s). There are 73 watchers for this library.
                        summary
                        There were 4 major release(s) in the last 6 months.
                        summary
                        There are 335 open issues and 671 have been closed. On average issues are closed in 116 days. There are 20 open pull requests and 0 closed requests.
                        summary
                        It has a positive sentiment in the developer community.
                        summary
                        The latest version of protege is protege-parent-5.6.1
                        protege Support
                          Best in #Data Manipulation
                            Average in #Data Manipulation
                            protege Support
                              Best in #Data Manipulation
                                Average in #Data Manipulation

                                  kandi-Quality Quality

                                    summary
                                    protege has 0 bugs and 0 code smells.
                                    protege Quality
                                      Best in #Data Manipulation
                                        Average in #Data Manipulation
                                        protege Quality
                                          Best in #Data Manipulation
                                            Average in #Data Manipulation

                                              kandi-Security Security

                                                summary
                                                protege has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
                                                summary
                                                protege code analysis shows 0 unresolved vulnerabilities.
                                                summary
                                                There are 0 security hotspots that need review.
                                                protege Security
                                                  Best in #Data Manipulation
                                                    Average in #Data Manipulation
                                                    protege Security
                                                      Best in #Data Manipulation
                                                        Average in #Data Manipulation

                                                          kandi-License License

                                                            summary
                                                            protege has a Non-SPDX License.
                                                            summary
                                                            Non-SPDX licenses can be open source with a non SPDX compliant license, or non open source licenses, and you need to review them closely before use.
                                                            protege License
                                                              Best in #Data Manipulation
                                                                Average in #Data Manipulation
                                                                protege License
                                                                  Best in #Data Manipulation
                                                                    Average in #Data Manipulation

                                                                      kandi-Reuse Reuse

                                                                        summary
                                                                        protege releases are available to install and integrate.
                                                                        summary
                                                                        Deployable package is available in Maven.
                                                                        summary
                                                                        Build file is available. You can build the component from source.
                                                                        summary
                                                                        It has 86158 lines of code, 9576 functions and 1441 files.
                                                                        summary
                                                                        It has medium code complexity. Code complexity directly impacts maintainability of the code.
                                                                        protege Reuse
                                                                          Best in #Data Manipulation
                                                                            Average in #Data Manipulation
                                                                            protege Reuse
                                                                              Best in #Data Manipulation
                                                                                Average in #Data Manipulation
                                                                                  Top functions reviewed by kandi - BETA
                                                                                  kandi has reviewed protege and discovered the below as its top functions. This is intended to give you an instant insight into protege implemented functionality, and help decide if they suit your requirements.
                                                                                  • Initialise the checkboxes
                                                                                    • Updates the view based on the given property
                                                                                    • Adds a setter to the given checkbox
                                                                                    • Configure the setters
                                                                                  • Initialize the wizard
                                                                                    • Displays the currently selected panel
                                                                                    • Sets the current panel to the specified object
                                                                                  • Initialize the UI
                                                                                    • Updates whether or not the given orcid is enabled or not
                                                                                  • Main method for testing
                                                                                  • Creates the center panel
                                                                                  • Loads imports and imports
                                                                                  • Rebuild the view menu items
                                                                                  • Initialise the preview
                                                                                  • Creates the center panel for the document
                                                                                  • Paints the icon
                                                                                  • Initialise the OL view
                                                                                  • Prepare the styles
                                                                                  • Provides a renderer for the given value
                                                                                  • Creates the UI
                                                                                  • Gets the tool tip text
                                                                                  • Layout the lines
                                                                                  • Update the node
                                                                                  • This method initialises the panel
                                                                                  • Create and copy the view
                                                                                  • Paint the action icon
                                                                                  Get all kandi verified functions for this library.
                                                                                  Get all kandi verified functions for this library.

                                                                                  protege Key Features

                                                                                  Protege Desktop

                                                                                  protege Examples and Code Snippets

                                                                                  No Code Snippets are available at this moment for protege.
                                                                                  Community Discussions

                                                                                  Trending Discussions on protege

                                                                                  SPARQL Query the triples created using Protégé ontological approach for distinct classes with object properties
                                                                                  chevron right
                                                                                  SPARQL query answers for Punned Entities in Ontology
                                                                                  chevron right
                                                                                  How is: "A subclassOf of B, C" interpreted? As AND or OR in rdfs / owl / description logic?
                                                                                  chevron right
                                                                                  How to create a knowledge graph from a pandas dataframe using RDFLIB library in Python
                                                                                  chevron right
                                                                                  How to produce triple with differentFrom vocab in OWLAPI
                                                                                  chevron right
                                                                                  When using rdfs:subClassOf or owl:equivalentClass in case of existential quantification (owl:SomeValuesFrom) for a OWL class restriction constructor?
                                                                                  chevron right
                                                                                  Infer Anonymous class in Protege with the Rules Tab
                                                                                  chevron right
                                                                                  Some subclasses seem deliberately missing from the SSN ontology RDF. Is there a way to import a complete SSN ontology?
                                                                                  chevron right
                                                                                  How to access the child elements of an element with minidom?
                                                                                  chevron right
                                                                                  Inferencing the Sematincs of Equality (OWL 2 RL) using owlapi
                                                                                  chevron right

                                                                                  QUESTION

                                                                                  SPARQL Query the triples created using Protégé ontological approach for distinct classes with object properties
                                                                                  Asked 2022-Apr-03 at 18:52

                                                                                  I have a question about querying the object properties that can be defined between classes.I have created triples using the protege ontological approach where,I have created two classes named "A" and "B" with instances A1, A2, A3, and B1, B2, and B3 respectively.

                                                                                  I have added an object property "aToB". Now I want to write a Query that can query the instances under each class using the object property.for which I have written the following QUERY

                                                                                  PREFIX rdf: 
                                                                                  PREFIX owl: 
                                                                                  PREFIX rdfs: 
                                                                                  PREFIX xsd: 
                                                                                  PREFIX  : 
                                                                                  SELECT ?x ?y
                                                                                      WHERE { ?x :AtoB ?y}
                                                                                  

                                                                                  however, upon doing this procedure nothing is returned can you tell me what is the issue?

                                                                                  I am adding the TTL code:

                                                                                  @prefix :  .
                                                                                  @prefix ab:  .
                                                                                  @prefix owl:  .
                                                                                  @prefix rdf:  .
                                                                                  @prefix xml:  .
                                                                                  @prefix xsd:  .
                                                                                  @prefix rdfs:  .
                                                                                  @base  .
                                                                                  
                                                                                   rdf:type owl:Ontology .
                                                                                  
                                                                                  #################################################################
                                                                                  #    Object Properties
                                                                                  #################################################################
                                                                                  
                                                                                  ###  http://www.semanticweb.org/arash#aToB
                                                                                  ab:aToB rdf:type owl:ObjectProperty ;
                                                                                          owl:inverseOf ab:bToA ;
                                                                                          rdfs:domain ab:A ;
                                                                                          rdfs:range ab:B .
                                                                                  
                                                                                  
                                                                                  ###  http://www.semanticweb.org/arash#bToA
                                                                                  ab:bToA rdf:type owl:ObjectProperty .
                                                                                  
                                                                                  
                                                                                  #################################################################
                                                                                  #    Classes
                                                                                  #################################################################
                                                                                  
                                                                                  ###  http://www.semanticweb.org/arash#A
                                                                                  ab:A rdf:type owl:Class .
                                                                                  
                                                                                  
                                                                                  ###  http://www.semanticweb.org/arash#B
                                                                                  ab:B rdf:type owl:Class .
                                                                                  
                                                                                  
                                                                                  #################################################################
                                                                                  #    Individuals
                                                                                  #################################################################
                                                                                  
                                                                                  ###  http://www.semanticweb.org/arash#A1
                                                                                  ab:A1 rdf:type owl:NamedIndividual ,
                                                                                                 ab:A ;
                                                                                        ab:aToB ab:A1 .
                                                                                  
                                                                                  
                                                                                  ###  http://www.semanticweb.org/arash#A2
                                                                                  ab:A2 rdf:type owl:NamedIndividual ,
                                                                                                 ab:A ;
                                                                                        ab:aToB ab:B2 .
                                                                                  
                                                                                  
                                                                                  ###  http://www.semanticweb.org/arash#A3
                                                                                  ab:A3 rdf:type owl:NamedIndividual ,
                                                                                                 ab:A .
                                                                                  
                                                                                  
                                                                                  ###  http://www.semanticweb.org/arash#B1
                                                                                  ab:B1 rdf:type owl:NamedIndividual ,
                                                                                                 ab:B ;
                                                                                        ab:aToB ab:A1 .
                                                                                  
                                                                                  
                                                                                  ###  http://www.semanticweb.org/arash#B2
                                                                                  ab:B2 rdf:type owl:NamedIndividual ,
                                                                                                 ab:B .
                                                                                  
                                                                                  
                                                                                  ###  http://www.semanticweb.org/arash#B3
                                                                                  ab:B3 rdf:type owl:NamedIndividual ,
                                                                                                 ab:B ;
                                                                                        ab:aToB ab:A3 ;
                                                                                        owl:topDataProperty "" .
                                                                                  
                                                                                  
                                                                                  [ ab:aToB ab:A1
                                                                                  ] .
                                                                                  
                                                                                  ###  Generated by the OWL API (version 4.5.9.2019-02-01T07:24:44Z) https://github.com/owlcs/owlapi
                                                                                  

                                                                                  ANSWER

                                                                                  Answered 2022-Apr-03 at 18:52

                                                                                  The prefix in your query is missing the closing #.

                                                                                  Source https://stackoverflow.com/questions/71720821

                                                                                  QUESTION

                                                                                  SPARQL query answers for Punned Entities in Ontology
                                                                                  Asked 2022-Mar-11 at 14:06

                                                                                  I have built a small ontology in Protege to test punning with a SPARQL query. The Ontology is:

                                                                                  
                                                                                  
                                                                                      
                                                                                      
                                                                                      
                                                                                      
                                                                                      
                                                                                      
                                                                                          
                                                                                      
                                                                                      
                                                                                          
                                                                                      
                                                                                      
                                                                                          
                                                                                      
                                                                                      
                                                                                          
                                                                                      
                                                                                      
                                                                                          
                                                                                      
                                                                                      
                                                                                          
                                                                                      
                                                                                      
                                                                                          
                                                                                      
                                                                                      
                                                                                          
                                                                                      
                                                                                      
                                                                                          
                                                                                      
                                                                                      
                                                                                          
                                                                                      
                                                                                      
                                                                                          
                                                                                      
                                                                                      
                                                                                          
                                                                                      
                                                                                      
                                                                                          
                                                                                          
                                                                                      
                                                                                      
                                                                                          
                                                                                          
                                                                                      
                                                                                      
                                                                                          
                                                                                          
                                                                                      
                                                                                      
                                                                                          
                                                                                          
                                                                                      
                                                                                      
                                                                                          
                                                                                          
                                                                                      
                                                                                      
                                                                                          
                                                                                          
                                                                                          
                                                                                      
                                                                                  
                                                                                  
                                                                                  
                                                                                  
                                                                                  
                                                                                  

                                                                                  And the SPARQL query that i am using to test the pun entity (GE) is:

                                                                                  SELECT ?y ?x ?z
                                                                                      WHERE { 
                                                                                          ?x a ?y.    
                                                                                          ?z a ?x.    
                                                                                          ?z :Lives_in :CPZ.  
                                                                                  }
                                                                                  

                                                                                  An the output that i am getting is:

                                                                                  my question is why I am getting 6 answers instead of the first one in output? and what does the other 5 bindings of ?y(owl:Class and owl:NamedIndividual) mean?

                                                                                  Thank you!

                                                                                  ANSWER

                                                                                  Answered 2022-Mar-11 at 14:06

                                                                                  Harry is a GE, from your assertions. GE is both a class and an individual; so GE appears in other statements as well, and that's multiplying the answers you're seeing. It's analogous as joining across tables where the join value matches multiple rows in one of the tables involved.

                                                                                  Source https://stackoverflow.com/questions/71425038

                                                                                  QUESTION

                                                                                  How is: "A subclassOf of B, C" interpreted? As AND or OR in rdfs / owl / description logic?
                                                                                  Asked 2022-Feb-01 at 21:13

                                                                                  Is the following interpreted as the intersection (AND) in the sense that members of class A are members of B and C; or as the disjunction (OR) that members of A are a member of B, or a member of C, or member of both?

                                                                                  A rdf:type owl:Class ;
                                                                                     rdfs:subClassOf some B; 
                                                                                     rdfs:subClassOf only C. 
                                                                                  

                                                                                  Thanks for clarification how this is interpreted!

                                                                                  I found it as AND: Protege OWL Subclass of two classes

                                                                                  But Hermit breaks it and uses single axioms (e.g. A rdfs:subclassOf B) as explanation for A to B. I thought that would not be possible ...? Since I would say that A is a subclassOf (B and C) and not only A.

                                                                                  ANSWER

                                                                                  Answered 2022-Feb-01 at 00:33

                                                                                  I can quote RDFS, and considering OWL should follow from that, I don't expect any difference there:

                                                                                  If a class C is a subclass of a class C', then all instances of C will also be instances of C'. The rdfs:subClassOf property may be used to state that one class is a subclass of another.

                                                                                  Class inheritance axioms in RDFS are built so that a contradiction can never occur, thus a statement like this can only be "additive" in a sense. Additionally, from the nature of triples in RDF, we know that A rdfs:subClassOf B, C. means A rdfs:subClassOf B. A rdfs:subClassOf C..

                                                                                  Expressed in the language of sets, such a construction means A ⊆ B ∧ A ⊆ C. Any member of A is also a member of B, and any member of A is also a member of C, thus any member of A must be a member of both B and C. We can see that A ⊆ (B ∩ C), from the duality of set and logical operators.

                                                                                  Expressed equivalently, any member of B not found in C must also not be in A (and the same for B and C swapped).

                                                                                  Source https://stackoverflow.com/questions/70853378

                                                                                  QUESTION

                                                                                  How to create a knowledge graph from a pandas dataframe using RDFLIB library in Python
                                                                                  Asked 2022-Jan-29 at 14:10

                                                                                  I have a df from which I need to create a Knowledge Graph using RDFlib library in Python. So that I can visualize the created knowledge graph in various visualization tools like Protege, Webowl etc. How can this be done?

                                                                                  ANSWER

                                                                                  Answered 2022-Jan-29 at 14:10

                                                                                  Here is my approach based on this answer. See also this notebook for outputs.

                                                                                  
                                                                                  import pandas as pd
                                                                                  from rdflib import Graph, URIRef, Namespace
                                                                                  
                                                                                  d = {
                                                                                      "source": pd.Series(["Edwin", "Reema", "Ron", "Tomorrow"]),
                                                                                      "target": pd.Series(["football", "karate", "singer", "holiday"]),
                                                                                      "edge": pd.Series(["plays", "plays", "is", "is"]),
                                                                                  }
                                                                                  
                                                                                  df = pd.DataFrame(d)
                                                                                  
                                                                                  g = Graph()
                                                                                  n = Namespace('http://example.org/foo/')
                                                                                  
                                                                                  for inded, row in df.iterrows():
                                                                                      # add triple to rdf-graph
                                                                                      g.add((URIRef(n+row["source"]), URIRef(n+row["edge"]), URIRef(n+row["target"])))
                                                                                  
                                                                                  print(g.serialize(format='turtle'))
                                                                                  

                                                                                  With some additional visualization code (based on https://stackoverflow.com/a/61483971/333403) you arrive at:

                                                                                  Source https://stackoverflow.com/questions/70875222

                                                                                  QUESTION

                                                                                  How to produce triple with differentFrom vocab in OWLAPI
                                                                                  Asked 2021-Dec-23 at 13:03

                                                                                  I tried to create different individual axiom using OWLAPI 5 in Java. What I want is simple triple using vocab owl:differentFrom like:

                                                                                  test:A owl:differentFrom test:B
                                                                                  

                                                                                  But what I get is triple using owl:AllDifferent:

                                                                                  _:genid234 rdf:type owl:AllDifferent
                                                                                  _:genid234 owl:distinctMembers _:genid236
                                                                                  _:genid236 rdf:rest _:genid235
                                                                                  _:genid236 rdf:rest rdf:nil
                                                                                  _:genid235 rdf:first test:A
                                                                                  _:genid235 rdf:type rdf:List
                                                                                  _:genid236 rdf:first test:B
                                                                                  _:genid236 rdf:type rdf:List
                                                                                  

                                                                                  And the simple code is:

                                                                                  OWLNamedIndividual op1 = factory.getOWLNamedIndividual(baseIRI + A);
                                                                                  OWLNamedIndividual op2 = factory.getOWLNamedIndividual(baseIRI + B);
                                                                                  ont.add(factory.getOWLDifferentIndividualsAxiom(op1, op2));
                                                                                  

                                                                                  And I already tried it with Protege 5.5.0, it produce exactly the same triple as OWLAPI.

                                                                                  ANSWER

                                                                                  Answered 2021-Dec-23 at 13:03

                                                                                  There is an alternative implementation of OWLAPI-v5 that provides a direct way to work with underlying RDF data - ONT-API (by the way, RDF based Protege version also exists). If working via OWLAPI interface for two operands it produces a single triple.

                                                                                  Also it is possible to copy ontology between ont-api manager and owl-api-impl managers, if you prefer to store the data in the form of OWL axioms and need to solve only this particular problem with serialization.

                                                                                  example:

                                                                                          String iri = "http://test#";
                                                                                          OWLDataFactory factory = OntManagers.getDataFactory();
                                                                                          Ontology ont = OntManagers.createManager().createOntology();
                                                                                          ont.asGraphModel().setNsPrefix("test", iri);
                                                                                  
                                                                                          OWLNamedIndividual ia = factory.getOWLNamedIndividual(iri + "A");
                                                                                          OWLNamedIndividual ib = factory.getOWLNamedIndividual(iri + "B");
                                                                                          OWLNamedIndividual ic = factory.getOWLNamedIndividual(iri + "C");
                                                                                  
                                                                                          ont.add(factory.getOWLDifferentIndividualsAxiom(ia, ib, ic));
                                                                                  
                                                                                          ont.add(factory.getOWLDifferentIndividualsAxiom(ia, ic));
                                                                                  
                                                                                          OntModel g = ont.asGraphModel();
                                                                                  
                                                                                          g.createIndividual(iri + "D").addDifferentIndividual(g.createIndividual(iri + "C"));
                                                                                          g.createDifferentIndividuals(g.createIndividual(iri + "e"), g.createIndividual(iri + "g"));
                                                                                  
                                                                                          g.write(System.out, "ttl");
                                                                                          System.out.println("=".repeat(42));
                                                                                          ont.axioms().forEach(System.out::println);
                                                                                  

                                                                                  out:

                                                                                  @prefix owl:   .
                                                                                  @prefix rdf:   .
                                                                                  @prefix rdfs:  .
                                                                                  @prefix test:  .
                                                                                  @prefix xsd:   .
                                                                                  
                                                                                  [ rdf:type     owl:AllDifferent ;
                                                                                    owl:members  ( test:e test:g )
                                                                                  ] .
                                                                                  
                                                                                  test:g  rdf:type  owl:NamedIndividual .
                                                                                  
                                                                                  test:B  rdf:type  owl:NamedIndividual .
                                                                                  
                                                                                  [ rdf:type  owl:Ontology ] .
                                                                                  
                                                                                  test:e  rdf:type  owl:NamedIndividual .
                                                                                  
                                                                                  test:C  rdf:type  owl:NamedIndividual .
                                                                                  
                                                                                  test:A  rdf:type           owl:NamedIndividual ;
                                                                                          owl:differentFrom  test:C .
                                                                                  
                                                                                  test:D  rdf:type           owl:NamedIndividual ;
                                                                                          owl:differentFrom  test:C .
                                                                                  
                                                                                  [ rdf:type             owl:AllDifferent ;
                                                                                    owl:distinctMembers  ( test:A test:B test:C )
                                                                                  ] .
                                                                                  ==========================================
                                                                                  Declaration(NamedIndividual(test:g))
                                                                                  Declaration(NamedIndividual(test:e))
                                                                                  Declaration(NamedIndividual(test:D))
                                                                                  Declaration(NamedIndividual(test:C))
                                                                                  Declaration(NamedIndividual(test:B))
                                                                                  Declaration(NamedIndividual(test:A))
                                                                                  DifferentIndividuals(test:C test:D)
                                                                                  DifferentIndividuals(test:A test:C)
                                                                                  DifferentIndividuals(test:e test:g)
                                                                                  DifferentIndividuals(test:A test:B test:C)
                                                                                  

                                                                                  Source https://stackoverflow.com/questions/70443271

                                                                                  QUESTION

                                                                                  When using rdfs:subClassOf or owl:equivalentClass in case of existential quantification (owl:SomeValuesFrom) for a OWL class restriction constructor?
                                                                                  Asked 2021-Dec-23 at 09:25

                                                                                  We define a class A as owl:equivalentClass and a class A2 as rdfs:subClassOf based on the intersection (AND) of instances having a relation a_to_b and a_to_c with an instance of B or C respectively. Please see the example:

                                                                                  :A rdf:type owl:Class ;
                                                                                     owl:equivalentClass [ owl:intersectionOf ( [ rdf:type owl:Restriction ;
                                                                                                                                  owl:onProperty :a_to_b ;
                                                                                                                                  owl:someValuesFrom :B
                                                                                                                                ]
                                                                                                                                [ rdf:type owl:Restriction ;
                                                                                                                                  owl:onProperty :a_to_c ;
                                                                                                                                  owl:someValuesFrom :C
                                                                                                                                ]
                                                                                                                              ) ;
                                                                                                           rdf:type owl:Class
                                                                                                         ] .
                                                                                  

                                                                                  Here as a subclass:

                                                                                  :A2 rdf:type owl:Class ;
                                                                                     rdfs:subClassOf [ owl:intersectionOf ( [ rdf:type owl:Restriction ;
                                                                                                                              owl:onProperty :a_to_b ;
                                                                                                                              owl:someValuesFrom :B
                                                                                                                            ]
                                                                                                                            [ rdf:type owl:Restriction ;
                                                                                                                              owl:onProperty :a_to_c ;
                                                                                                                              owl:someValuesFrom :C
                                                                                                                            ]
                                                                                                                          ) ;
                                                                                                       rdf:type owl:Class
                                                                                                     ] .
                                                                                  

                                                                                  What is the reason to use owl:equivalentClass and when would I use rdfs:subClassOf? The distinction and what is really expressed at the end is not fully clear to me.

                                                                                  My further observation / questions:

                                                                                  a) When I create an instance x with triples: (x, a_to_b, b1) and (x, a_to_c, c1), x is automatically reasoned as a type of A but not of A2. (Using Protege with Hermit Reasoner) (c1 is type of C and b1 is type of B).

                                                                                  b) When I create an instance y and assign y the type A and A2 manually, would this be an issue if y has no relation to an instance of B via a_to_b and no relation to an instance of C via a_to_c? The Hermit Reasoner does not show any signs of an issue but is that not a necessary (must be fulfilled) condition for class A?

                                                                                  c) Are these statements true for A:

                                                                                  c1) If I know that z is from type A, it must have a relation a_to_b with an instance of B and it must have a relation a_to_C with an instance of C.

                                                                                  c2) If I know that z have a relation a_to_b with an instance of B and it have a relation a_to_C with an instance of C, z must be of type A.

                                                                                  c3) A is the class of all things that have a relation a_to_b with an instance of B and have a relation a_to_C with an instance of C.

                                                                                  Can I say c1 and c3 also about A2 or how to the statements change?

                                                                                  The meaning is not clear to me. I hope someone can clarify things. Thanks in advance

                                                                                  ANSWER

                                                                                  Answered 2021-Dec-23 at 09:25

                                                                                  I think the first thing to be aware of is that equivalence, say D equivalentClass E, is an abbreviation for D subClassOf E and E subClassOf D. The semantics of subClassOf is subset. This means that the set D is a subset of set E and set E is a subset of D, which means set D and set E are exactly the same set. We say they are equivalent.

                                                                                  Note now the semantics of subClassOf. If I know F subClassOf E and G subClassOf E, what can I say about how F and G relates to each other? Absolutely nothing. It is a bit like knowing a bicycle and a truck are both vehicles. That does not make a bicycle a truck or a truck a bicycle, though both are vehicles.

                                                                                  Thus, in your example, A can be expanded to the 2 axioms

                                                                                  A subClassOf (a_to_b some B) and (a_to_c some C)

                                                                                  (a_to_b some B) and (a_to_c some C) subClassOf A

                                                                                  Answers to your questions:

                                                                                  (a) With the assertions for x as you have it, we can see that x is indeed an instance of A. However, there is no information wrt x that makes it possible for us to say x is of type A2. All we know is that both x and A2 are subclasses of (a_to_b some B) and (a_to_c some C).

                                                                                  (b) This is due to the Open World Assumption, which means the reasoner does not make any assumptions based on the absence of information. If you have not stated explicitly that y has no a_to_b relation to B, it will assume that an a_to_b relation exists but is merely not known. This is as opposed to the closed world assumption made by databases usually. I.e., if no employer information exists for a client the assumption is often made that the client is not employed.

                                                                                  You can state that y has no a_to_b relation by stating that a_to_b max 0 B. The reasoner will then give an inconsistency.

                                                                                  (c1) yes, but these may not be known currently due to the open world assumption.

                                                                                  (c2) yes, based on the semantics of equivalence

                                                                                  (c3) yes.

                                                                                  This is not true for A2 because it is merely a subclass rather than all things that have a relation a_to_b with an instance of B and have a relation a_to_C with an instance of C.

                                                                                  When to use equivalent vs subClassOf

                                                                                  Equivalence is used for definitions. That is when you want to state the necessary and sufficient conditions for something to be called an A (from your example).

                                                                                  SubClassOf is used when you want to define a hierarchy from most general to most specific. I.e., it is typically what you see in taxonomies and in programming you will see it as object oriented class hierarchies.

                                                                                  Source https://stackoverflow.com/questions/70386593

                                                                                  QUESTION

                                                                                  Infer Anonymous class in Protege with the Rules Tab
                                                                                  Asked 2021-Sep-08 at 11:05

                                                                                  I would like to infer an anonymous class definition for my Individuals in Protege.

                                                                                  I have a simple Ontology with the Classes Rain NoRain and Scene, The object Property has_weather. My desire is to be able to infer "has_weather(?x, ?noRain), NoRain(?noRain), Scene(?x) -> (has_weather exactly 0 Rain)(?x) which i wrote in the Rules tab, where i can mix SWRL and OWL Expressions.

                                                                                  I am using Pellet Reasoner, however I also tried with OnTop and Hermit and none works. For example if I do the rule the other way around:

                                                                                  `has_weather(?x, ?noRain), (has_weather exactly 0 Rain)(?x), Scene(?x) -> Test(?x)`
                                                                                  

                                                                                  It works without problems.

                                                                                  Is the problem, that Protege just can't infer anonymous classes? Is there any workaround? Thank you in Advance!

                                                                                  here is the code to the ontology

                                                                                  
                                                                                  
                                                                                  
                                                                                  
                                                                                  
                                                                                  
                                                                                  
                                                                                  
                                                                                      
                                                                                  
                                                                                  
                                                                                  
                                                                                  
                                                                                  
                                                                                  
                                                                                  
                                                                                  
                                                                                  
                                                                                  
                                                                                  
                                                                                  
                                                                                      
                                                                                  
                                                                                  
                                                                                  
                                                                                  
                                                                                  
                                                                                  
                                                                                  
                                                                                  
                                                                                  
                                                                                  
                                                                                  
                                                                                  
                                                                                  
                                                                                  
                                                                                  
                                                                                  
                                                                                  
                                                                                  
                                                                                  
                                                                                  
                                                                                  
                                                                                  
                                                                                  
                                                                                  
                                                                                      
                                                                                  
                                                                                  
                                                                                  
                                                                                  
                                                                                  
                                                                                  
                                                                                  
                                                                                      
                                                                                      
                                                                                  
                                                                                  
                                                                                  
                                                                                  
                                                                                  
                                                                                  
                                                                                  
                                                                                      
                                                                                  
                                                                                  
                                                                                      
                                                                                  
                                                                                  
                                                                                      
                                                                                      
                                                                                          
                                                                                              
                                                                                              
                                                                                                  
                                                                                                      
                                                                                                      
                                                                                                      
                                                                                                      
                                                                                                  
                                                                                              
                                                                                              
                                                                                                  
                                                                                                      
                                                                                                      
                                                                                                          
                                                                                                              
                                                                                                              
                                                                                                              
                                                                                                          
                                                                                                      
                                                                                                      
                                                                                                          
                                                                                                              
                                                                                                              
                                                                                                                  
                                                                                                                      
                                                                                                                      
                                                                                                                      
                                                                                                                  
                                                                                                              
                                                                                                              
                                                                                                          
                                                                                                      
                                                                                                  
                                                                                              
                                                                                          
                                                                                      
                                                                                      
                                                                                          
                                                                                              
                                                                                              
                                                                                                  
                                                                                                      
                                                                                                      
                                                                                                          
                                                                                                              
                                                                                                              0
                                                                                                              
                                                                                                          
                                                                                                      
                                                                                                      
                                                                                                  
                                                                                              
                                                                                              
                                                                                          
                                                                                      
                                                                                  
                                                                                  

                                                                                  `

                                                                                  ANSWER

                                                                                  Answered 2021-Sep-08 at 11:05

                                                                                  In general a set of axioms has an infinite amout of entailments. See for example this paper. For this reason reasoners restrict inferences to known classes (not anonymous classes). I suspect this holds true for rules as well.

                                                                                  I therefore suggest you add a class NoRain that you set equivalent to has_weather 0 Rain and change your SWRL rule to use the class NoRain.

                                                                                  Source https://stackoverflow.com/questions/69101093

                                                                                  QUESTION

                                                                                  Some subclasses seem deliberately missing from the SSN ontology RDF. Is there a way to import a complete SSN ontology?
                                                                                  Asked 2021-May-27 at 05:50

                                                                                  I am using Protege to explore the SSN ontology,
                                                                                  but a lot of classes like the survivalRange seem to be missing from the main file.

                                                                                  How could I import all the classes and entities of the ssn-system,
                                                                                  without importing them manually one by one by the IRI?

                                                                                  ANSWER

                                                                                  Answered 2021-May-27 at 05:50

                                                                                  You can import http://www.w3.org/ns/ssn/systems/, which itself imports http://www.w3.org/ns/ssn/.

                                                                                  Source https://stackoverflow.com/questions/67713883

                                                                                  QUESTION

                                                                                  How to access the child elements of an element with minidom?
                                                                                  Asked 2021-May-24 at 06:46

                                                                                  I am reading an XML/OWL file (generated from Protege) in Jupyter notebook.

                                                                                  I can read the root element, but for children its showing error/blank.

                                                                                  from xml.dom.minidom import parse
                                                                                  
                                                                                  DOMTree = parse("pressman.owl")
                                                                                  collection = DOMTree.documentElement
                                                                                  
                                                                                  if collection.hasAttribute("shelf"):
                                                                                     print("Root element : %s" % collection.getAttribute("owl:ObjectProperty"))
                                                                                  
                                                                                  for objectprop in collection.getElementsByTagName("owl:ObjectProperty"):
                                                                                      if objectprop.hasAttribute("rdf:about"):
                                                                                              propertytext = objectprop.getAttribute("rdf:about")
                                                                                              property = propertytext.split('#',2)
                                                                                              print ("Property: %s" % property[1])
                                                                                              type = objectprop.getElementsByTagName('rdf:resource')
                                                                                              print ("Type: %s" % type)
                                                                                  

                                                                                  and the pressman.owl file (abridged):

                                                                                  
                                                                                      
                                                                                      
                                                                                      
                                                                                  
                                                                                      
                                                                                  
                                                                                      
                                                                                          
                                                                                          
                                                                                          
                                                                                      
                                                                                  
                                                                                      
                                                                                          
                                                                                          
                                                                                          
                                                                                      
                                                                                  
                                                                                          
                                                                                  
                                                                                  

                                                                                  The output fis

                                                                                  Property: hasAdvice
                                                                                  Type: []
                                                                                  Property: hasDefinition
                                                                                  Type: []
                                                                                  Property: hasDiagram
                                                                                  Type: []
                                                                                  

                                                                                  ANSWER

                                                                                  Answered 2021-May-24 at 06:46

                                                                                  You have this structure

                                                                                  
                                                                                      
                                                                                      
                                                                                      
                                                                                  
                                                                                  

                                                                                  and you're using

                                                                                  type = objectprop.getElementsByTagName('rdf:resource')
                                                                                  

                                                                                  This cannot work, because rdf:resource is not an element, it's an attribute. I assume the one you're interested in belongs to . So we need to go one more level down:

                                                                                  rdf_type = objectprop.getElementsByTagName('rdf:type')
                                                                                  

                                                                                  Now rdf_type is a node list - after all the method is called "get elements by tag name", and minidom cannot know that there only might be a single in your case. We take the first one, if it exists:

                                                                                  rdf_type = rdf_type[0] if len(rdf_type) > 0 else None
                                                                                  

                                                                                  Now rdf:resource is an attribute on that element. Attributes are accessed through .getAttribute() in minidom.

                                                                                  In theory, the rdf:resource attribute could be is missing in the XML, so let's make sure it exists before using it:

                                                                                  if rdf_type is not None and rdf_type.hasAttribute('rdf:resource'):
                                                                                      rdf_resource = rdf_type.getAttribute('rdf:resource')
                                                                                  else:
                                                                                      rdf_resource = None
                                                                                  
                                                                                  print(rdf_resource)
                                                                                  

                                                                                  All that being said, instead of manually wrestling with RDF files, it might be worthwhile to check out libraries that were written for RDF, such as rdflib, or even for OWL specifically, such as pyLODE.

                                                                                  Source https://stackoverflow.com/questions/67667051

                                                                                  QUESTION

                                                                                  Inferencing the Sematincs of Equality (OWL 2 RL) using owlapi
                                                                                  Asked 2021-May-16 at 14:02

                                                                                  I'm trying to produce entailment for the rule in OWL 2 RL 'The Semantics of Equality' using owl-api. I already tried to follow: Why the inferences visualised in Protege differ from the exported inferred axioms

                                                                                  genInferred.add(new InferredSubClassAxiomGenerator());
                                                                                  genInferred.add(new InferredClassAssertionAxiomGenerator());
                                                                                  genInferred.add(new InferredDisjointClassesAxiomGenerator());
                                                                                  genInferred.add(new InferredEquivalentClassAxiomGenerator());
                                                                                  genInferred.add(new InferredEquivalentDataPropertiesAxiomGenerator());
                                                                                  genInferred.add(new InferredEquivalentObjectPropertyAxiomGenerator());
                                                                                  genInferred.add(new InferredInverseObjectPropertiesAxiomGenerator());
                                                                                  genInferred.add(new InferredObjectPropertyCharacteristicAxiomGenerator());
                                                                                  genInferred.add(new InferredPropertyAssertionGenerator());
                                                                                  genInferred.add(new InferredSubDataPropertyAxiomGenerator());
                                                                                  genInferred.add(new InferredSubObjectPropertyAxiomGenerator());
                                                                                  

                                                                                  And try to precomputed the same individual inference:

                                                                                  reasoner.precomputeInferences(InferenceType.SAME_INDIVIDUAL);
                                                                                  ontologyInf.addAxioms(reasoner.getPendingAxiomAdditions());
                                                                                  

                                                                                  I already try using Openllet and hermit as reasoner.

                                                                                  But I still can't produce entailment like this:

                                                                                  If:
                                                                                  T(?x, owl:sameAs, ?y)
                                                                                  T(?y, owl:sameAs, ?z) 
                                                                                  Then:
                                                                                  T(?x, owl:sameAs, ?z)
                                                                                  

                                                                                  or anything in Semantics of Equality.

                                                                                  ANSWER

                                                                                  Answered 2021-May-16 at 14:02

                                                                                  There is no inferred axiom generator that materialises the sameAs relations. You could write one yourself, based e.g., on InferredPropertyAssertionGenerator, or you can open an issue on the OWLAPI GitHub repo for the functionality to be added to the library.

                                                                                  Source https://stackoverflow.com/questions/67546978

                                                                                  Community Discussions, Code Snippets contain sources that include Stack Exchange Network

                                                                                  Vulnerabilities

                                                                                  No vulnerabilities reported

                                                                                  Install protege

                                                                                  You can download it from GitHub, Maven.
                                                                                  You can use protege like any standard Java library. Please include the the jar files in your classpath. You can also use any IDE and you can run and debug the protege component as you would do with any other Java program. Best practice is to use a build tool that supports dependency management such as Maven or Gradle. For Maven installation, please refer maven.apache.org. For Gradle installation, please refer gradle.org .

                                                                                  Support

                                                                                  For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
                                                                                  Find more information at:
                                                                                  Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
                                                                                  Find more libraries
                                                                                  Explore Kits - Develop, implement, customize Projects, Custom Functions and Applications with kandi kits​
                                                                                  Save this library and start creating your kit

                                                                                  Share this Page

                                                                                  share link

                                                                                  Explore Related Topics

                                                                                  Consider Popular Data Manipulation Libraries

                                                                                  Try Top Libraries by protegeproject

                                                                                  webprotege

                                                                                  by protegeprojectJava

                                                                                  swrlapi

                                                                                  by protegeprojectJava

                                                                                  cellfie-plugin

                                                                                  by protegeprojectJava

                                                                                  owlviz

                                                                                  by protegeprojectJava

                                                                                  mapping-master

                                                                                  by protegeprojectJava

                                                                                  Compare Data Manipulation Libraries with Highest Support

                                                                                  numpy

                                                                                  by numpy

                                                                                  hapi-fhir

                                                                                  by jamesagnew

                                                                                  nbconvert

                                                                                  by jupyter

                                                                                  protege

                                                                                  by protegeproject

                                                                                  database

                                                                                  by blazegraph

                                                                                  Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
                                                                                  Find more libraries
                                                                                  Explore Kits - Develop, implement, customize Projects, Custom Functions and Applications with kandi kits​
                                                                                  Save this library and start creating your kit