Re: [protege-user] Question about OWL RDF-Based Semantics
Michael DeBellis <[email protected]>
| Newsgroups | gmane.comp.misc.ontology.protege.owl |
|---|---|
| Message-ID | <CALGFikd_Sj0W2KpOy2H74mBkk7=UxuAH6vOH4xVN9_nAXcaUuA@mail.gmail.com> |
> > Here's another example. In the input file, here is a definition: > oslc:allowedValue > a rdf:Property ; > rdfs:isDefinedBy oslc: ; > rdfs:label "allowedValue" ; > rdfs:comment "Specifies the allowed values for a property (may be more > than one)." . It's the same issue. "rdf:Property" is meaningless to OWL. It doesn't know what that is. The only properties OWL knows about are: owl:AnnotationProperty, owl:ObjectProperty, and owl:DatatypeProperty. You could make a case that Protege should just completely reject this file as not a valid OWL file because it isn't. But what Protege is trying to do is to make as much sense out of it as possible. So in the case of rdfs:Class, it converts that to owl:Class and in the case of rdf:Property it converts that to owl:AnnotationProperty because that is the closest thing in OWL to rdf:Property. The reason is that there are restrictions on what can be in the range of owl:ObjectProperty (must a subclass of owl:Thing) and there are restrictions on what can be in the range of owl:DatatypeProperty (must be a valid rdf datatype but can not be an owl:Class) but there are no such restrictions on owl:AnnotationProperty (nor on rdf:Property). In both those cases it is just an RDF graph so you can have it point to any RDF node so the best heuristic to use when Protege is reading a file that is supposed to be OWL and sees rdf:Property is to make it an Annotation property. I made a mistake in assuming Annotations would mean AnnotationProperty. They are. But unless I'm misunderstanding something you weren't using owl:AnnotationProperty you were using rdf:Property which isn't valid for an OWL file. I thought I had seen annotation properties in saved files. Apparently it > just treats rdf:Property as an rdfs:comment. I thought it turned them into Annotation properties but I could be wrong. The bottom line is using rdf:Property isn't valid OWL so you can't be sure how it is going to treat that. It would be just as valid to simply reject the file and say "error on line N" where N is the first line you are using rdf:Property instead of a valid OWL property or rdf:Class rather than owl:Class. Annotation properties are definitely saved in OWL files. You can see examples here: https://github.com/mdebellis/SPARQL_Tools/blob/main/Semtech_files/databases%20final.ttl Life would be simpler and more dependable if all the ontologies out there > were OWL2 DL ontologies I disagree. The profiles are very useful for large knowledge graphs. If you need a knowledge graph with 500 million triples or more (not at all uncommon for industry knowledge graphs) using the full OWL 2 DL profile can result in the reasoner being too slow, especially if you want it running in real time, like every few seconds because data is constantly being input to the graph, e.g., via some streaming tool like Kafka or Spark. But at least as I'm understanding, the problems you are having are not due to OWL profiles but rather because you aren't abiding by the OWL specification and are trying to use an RDF/RDFS file as an OWL file. Hope that makes sense. Let me know if I'm misunderstanding something. Cheers, Michael https://www.michaeldebellis.com/blog On Mon, Jan 20, 2025 at 10:18 AM Steve Vestal via protege-user < [email protected]> wrote: > Here's another example. In the input file, here is a definition: > > oslc:allowedValue > a rdf:Property ; > rdfs:isDefinedBy oslc: ; > rdfs:label "allowedValue" ; > rdfs:comment "Specifies the allowed values for a property (may be more > than one)." . > > If I load that file into Protege, do not turn on any reasoner, and then > save it in another file, I find > > ################################################################# > # Annotations > ################################################################# > > oslc:allowedValue rdfs:comment "Specifies the allowed values for a > property (may be more than one)." ; > rdfs:isDefinedBy <http://open-services.net/ns/core#> > <http://open-services.net/ns/core#> ; > rdfs:label "allowedValue" . > > I made a mistake in assuming Annotations would mean AnnotationProperty. I > thought I had seen annotation properties in saved files. Apparently it > just treats rdf:Property as an rdfs:comment. > > Life would be simpler and more dependable if all the ontologies out there > were OWL2 DL ontologies, and all imports were URLs to the Authoritative > Source of Truth. "The measure of a man is what he does with power. The > measure of reality is how often it ignores him." (Plato) > On 1/20/2025 11:39 AM, Michael DeBellis wrote: > > For example, the input file contained the statement >> oslc:Error a rdfs:Class ; >> but the saved file had the statement >> oslc:Error rdf:type owl:Class ; > > I'm guessing you had a file that you read in to Protege that had things > defined using rdfs:Class? If so then my best guess is that Protege was just > doing its best to translate that file into OWL format. owl:Class and > rdfs:Class are not the same thing. In a Protege ontology you shouldn't be > using rdfs:Class you should always use owl:Class. It has nothing to do with > which profile you use. There is a profile (in theory) called OWL Full but > IMO it should be called "OWL Don't Ever Use this Because if you do kiss any > reasoning goodbye" but that's sort of a long name. The point being that OWL > Full (actually, I think there is a different name for it now) is something > that is almost never useful because it includes things that make it > impossible to use a reasoner. > > I think the default profile is what used to be called OWL DL but is now > just called OWL2: https://www.w3.org/TR/owl2-overview/#Profiles > > And the various profiles: https://www.w3.org/TR/owl2-profiles/ are for > when you want to put limits on your use of OWL 2 in order to get faster > reasoning. To my knowledge there is no way to do this automatically in > Protege. I.e., it would be a nice to have feature where you could say "I > just want to use OWL 2 QL" and Protege would know to exclude the > appropriate kinds of axioms but I don't think that's possible and if you > want to restrict yourself to a profile other than OWL 2 you need to know > what to not include yourself. Although in my experience some reasoners > (e.g., AllegroGraph) can still handle OWL models that include expressions > that aren't included for performance reasons without a problem. They just > ignore those axioms. > > That's another thing about OWL profiles. AllegroGraph and probably other > triplestore vendors have their own subsets of OWL based on what they've > found that their customers most need vs. performance of the reasoner. Their > goal is to support very large graphs and still get acceptable reasoning > performance. Regarding other parts of your question: > >> I was aware that Protege (OWLAPI) does some modifications to the initial >> input in some cases. > > I'm not aware of this. I think Protege looks for certain triples that > define the various prefixes, the name of the ontology, etc. and may create > some default triples if it can't find them but otherwise it doesn't do any > modification of the file. > >> Are those modifications based on the RDF to DL transformations described >> in that standard? > > > As I understand it, it is more appropriate to think of it the other way. > When you edit in Protege you are thinking in terms of Description Logic > but what Protege generates for you is RDF/RDFS triples and when you save a > file it stores that information in one of several different possible > serialization formats (RDF/XML, Turtle, JSON-LD, etc.) > > Cheers, > Michael > https://www.michaeldebellis.com/blog > > On Sun, Jan 19, 2025 at 11:20 AM Steve Vestal via protege-user < > [email protected]> wrote: > >> For example, the input file contained the statement >> >> oslc:Error a rdfs:Class ; >> >> but the saved file had the statement >> >> oslc:Error rdf:type owl:Class ; >> >> >> On 1/19/2025 11:59 AM, Samson Tu wrote: >> >> Can you explain what you meant by the modifications Protégé (OWLAPI) makes to the initial input? >> >> Samson >> >> >> On Jan 19, 2025, at 5:46 AM, Steve Vestal via protege-user <[email protected]> <[email protected]> wrote: >> >> Someone recently pointed me to the "OWL 2 Web Ontology Language RDF-Based Semantics (Second Edition)" standard. I was aware that Protege (OWLAPI) does some modifications to the initial input in some cases. Are those modifications based on the RDF to DL transformations described in that standard? Is this related to OWL Full? >> >> >> _______________________________________________ >> protege-user mailing [email protected]://mailman.stanford.edu/mailman/listinfo/protege-user >> >> _______________________________________________ >> protege-user mailing list >> [email protected] >> https://mailman.stanford.edu/mailman/listinfo/protege-user >> > > _______________________________________________ > protege-user mailing [email protected]://mailman.stanford.edu/mailman/listinfo/protege-user > > _______________________________________________ > protege-user mailing list > [email protected] > https://mailman.stanford.edu/mailman/listinfo/protege-user > _______________________________________________ protege-user mailing list [email protected] https://mailman.stanford.edu/mailman/listinfo/protege-user