Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unexpected behavior with malformed triples #1056

Open
balhoff opened this issue Apr 13, 2022 · 0 comments
Open

unexpected behavior with malformed triples #1056

balhoff opened this issue Apr 13, 2022 · 0 comments

Comments

@balhoff
Copy link
Contributor

balhoff commented Apr 13, 2022

I'm not sure this is exactly a bug, since the input isn't fully correct OWL. But the behavior is unexpected: if an ontology includes an annotated axiom using a reserved term as the annotated property, an annotation for this axiom is placed on some other completely unrelated axiom. I would instead expect these triples to be left over as "unparsed triples". Here is an example input causing this behavior:

@prefix : <http://example.org/> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix xml: <http://www.w3.org/XML/1998/namespace> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@base <http://example.org/> .

<http://example.org/> rdf:type owl:Ontology .

#################################################################
#    Object Properties
#################################################################

###  http://example.org/p
:p rdf:type owl:ObjectProperty ;
   rdfs:subPropertyOf :q .


###  http://example.org/q
:q rdf:type owl:ObjectProperty .


#################################################################
#    Classes
#################################################################

###  http://example.org/A
:A rdf:type owl:Class .


#################################################################
#    Individuals
#################################################################

###  http://example.org/x
:x rdf:type owl:NamedIndividual .


###  Generated by the OWL API (version 4.5.9.2019-02-01T07:24:44Z) https://github.com/owlcs/owlapi


# Here are the triples causing the bad behavior
_:blank1 rdf:type owl:Axiom ;
   owl:annotatedSource _:blank2 ;
   owl:annotatedProperty rdf:first ;
   owl:annotatedTarget :x ;
   rdfs:comment "This rdf:first assertion is annotated" .

You can test the result using ROBOT like this:

robot convert -i input.ttl -o output.ofn

output.ofn will look like this:

Prefix(:=<http://example.org/>)
Prefix(owl:=<http://www.w3.org/2002/07/owl#>)
Prefix(rdf:=<http://www.w3.org/1999/02/22-rdf-syntax-ns#>)
Prefix(xml:=<http://www.w3.org/XML/1998/namespace>)
Prefix(xsd:=<http://www.w3.org/2001/XMLSchema#>)
Prefix(rdfs:=<http://www.w3.org/2000/01/rdf-schema#>)

Ontology(<http://example.org/>

Declaration(Class(:A))
Declaration(ObjectProperty(:p))
Declaration(ObjectProperty(:q))

############################
#   Object Properties
############################

# Object Property: :p (:p)

SubObjectPropertyOf(Annotation(rdfs:comment "This rdf:first assertion is annotated") :p :q)
)

The rdfs:comment is randomly attached to the SubObjectPropertyOf axiom.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant