rdflib/sparql destroying object properties

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

rdflib/sparql destroying object properties

diggymacd
I have an RDF/OWL ontology that interacts well with owlready2 except for inserts via sparql or rdflib.  For instance:
onto = get_ontology("file://c:/users/diggy/natlang/story.owl").load()
graph = default_world.as_rdflib_graph()
with onto:
    graph.update("""
    INSERT {
        <http://www.local/story#human4
        <http://www.local/story#hasGender
        <http://www.local/story#male> .
    } WHERE {} """)
after this insert, the triple is there (except Protege cannot see it!) and the domain and range entries for the hasGender property have been deleted!  I have tried this and similar queries, also with sparql, on this and several other ontologies, with almost random results.  In some cases it removes the object property entirely.  I must be doing something wrong.
Thanks in advance.
Diggy
Reply | Threaded
Open this post in threaded view
|

Re: rdflib/sparql destroying object properties

Jiba
Administrator
Hi,

I tried the following example, but I am unable to reproduce your problem. Could you send me a working example, please ?

Alternatively, you may want to try the Owlready native SPARQL engine, as follows:

with onto:
    default_world.sparql("""
    INSERT {
        <http://www.local/story#human4
        <http://www.local/story#hasGender
        <http://www.local/story#male> .
    } WHERE {} """)

Jiba
Reply | Threaded
Open this post in threaded view
|

Re: rdflib/sparql destroying object properties

diggymacd
Turns out there was some problem in the ontology; can't isolate it, but with other ontologies I have, owlready2 is working as advertised.  Thanks for looking into it, and thanks for a very useful package!