SameAs with graphs

I don’t know if this is a bug or not but it was somewhat curious. I was messing around with named graphs and I thought, “I wonder if sameAs reasoning works for graphs. I might be able to do something interesting if it was” so rather than ask I figured I’d give it a quick try to see.

Stardog 5.2.2

stardog-admin db create -o reasoning.sameas=FULL -n test

insert data {
    graph :x { :a :has :b }
    graph :y { :c :has :d }
    :a owl:sameAs :c

when you run the following without reasoning you get the expected results

select * where { graph ?g { ?s :has ?o }}

g    s    o
:y   :c   :d
:x   :a   :b

when you run it with reasoning, woo-hoo you get the canonical IRI. It works!

select * where { graph ?g { ?s :has ?o }}

g    s    o
:y   :c   :d
:y   :a   :b

but if I query for a specific graph with reasoning

select * where { graph :y { ?s :has ?o }}

you don’t get the union of the two graphs you just get the specific graph

s    o
:c   :d

I know the semantics of graphs are a little under specified so I’m under no illusion that this should work that way but just sayin’ it would be cool if it did :slight_smile:

Did you really mean :a owl:sameAs :c or :x owl:sameAs :y?


Sorry, my mistake it should have been :x owl:sameAs :y

Yeah, this wouldn’t be a required inference under the OWL semantics since in the OWL spec owl:sameAs is an equivalence relation over individuals, and named graphs are not individuals (OWL doesn’t have anything to do with named graphs).

However I don’t immediately see any fundamental problems extending the owl:sameAs semantics to graphs. We’ll consider it.


1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.