identifiers-org / identifiers-org.github.io

MIT License
9 stars 1 forks source link

Identifiers sparql should return the subject in addition to matches on owl:sameAs queries #248

Open renatocjn opened 1 week ago

renatocjn commented 1 week ago

Currently, when a query with a WHERE clause like ?s owl:sameAs ?o is answered by the sparql server, it returns other matching URIs but not the ones part of the query. It should return ?s, ?o and any other matching URI.

yayamamo commented 1 week ago

I'd like to obtain a list of triples having subjects that match the one at any of the subject and the object of ?s owl:sameAs ?o. If this is the case, the following query is enough.

SELECT DISTINCT ?p ?obj
WHERE {
  SERVICE <id.org> { ?s owl:sameAs ?o .}
  ?o ?p ?obj .
}

Otherwise, a kind of the following query is needed.

SELECT DISTINCT ?p ?obj
WHERE {
  SERVICE <id.org> { ?s owl:sameAs ?o .}
  {?s ?p ?obj .}
  UNION
  {?o ?p ?obj .}
}

Does this make sense?