- From: Seaborne, Andy <andy.seaborne@hp.com>
- Date: Sat, 15 Jan 2005 20:37:57 +0000
- To: Steve Harris <S.W.Harris@ecs.soton.ac.uk>
- Cc: RDF Data Access Working Group <public-rdf-dawg@w3.org>
Steve Harris wrote: > On Fri, Jan 14, 2005 at 03:38:01PM -0600, Dan Connolly wrote: > >>If you have a novel position on an issue, not represented by one of the >>options or even close, mail the wg with the issue name in the subject >>and I'll try to add it. > > > For the SOURCE issue I would like what Alberto and I do currently to be > considered, as in > http://www.w3.org/2001/sw/DataAccess/tests/#source-query-001 2 3 & 5 > AFAIK it is the only solution that was arrived at independently by more > than one working group member, and it represents our development and > support experience. > > The key feature is that the URI used to identify the triples (ie. bound by > the SOURCE keyword) is not neccesarily the URI that was resolve to > retreive the grpah, that may be got by following some predicate from the > SOURCE URI to the actual URI resolved (dc:sounrce in the testcases). > > This allows more that one version of a graph identified by the same URI to > be present in the store at one time, without confusion. > > - Steve > This is possible with the mechanism currently in the document. rq23 does not prescribe that the URI that names the graph is the URI it is read from and a predicate can connect the two - it's your choice Use of FROM or GRAPH is optional - the RDF dataset can be set externally but I have used them here so that the queries can go in a manifest. Recreating #source-query-001 as a test: Using urn:'s for the internal names so it is clear what's internal and what's the web URI. ================================= # Graph: <http://example.org/foaf/graph> # Read in and stored as <urn:x-local:graph1> @prefix foaf: <http://xmlns.com/foaf/0.1/> . _:a foaf:name "Alice" . _:a foaf:mbox <mailto:alice@work.example> . _:b foaf:name "Bob" . _:b foaf:mbox <mailto:bob@oldcorp.example.org> . ================================= # Graph: <http://example.org/foaf/graph> # Read in and stored as <urn:x-local:graph2> @prefix foaf: <http://xmlns.com/foaf/0.1/> . _:a foaf:name "Alice" . _:a foaf:mbox <mailto:alice@work.example> . _:b foaf:name "BOB" . _:b foaf:mbox <mailto:bob@newcorp.example.org> . ================================= Read from same URI - different contents ================================= # Provenance information: # Default graph @prefix dc: <http://purl.org/dc/elements/1.1/> . @prefix xsd: <http://www.w3.org/2001/XMLSchema#> . <urn:x-local:graph1> dc:source <http://example.org/foaf/graph> . <urn:x-local:graph1> dc:date "2004-12-06"^^xsd:date . <urn:x-local:graph2> dc:source <http://example.org/foaf/graph> . <urn:x-local:graph2> dc:date "2005-01-10"^^xsd:date . ================================= ==== Query 1 : PREFIX foaf: <http://xmlns.com/foaf/0.1/> PREFIX dc: <http://purl.org/dc/elements/1.1/> SELECT DISTINCT ?name ?source ?date # explicitly name the graphs just for clarity - note internal names # Manifest format can't express this externally. FROM <urn:x-local:details> # The place when provenance info is kept GRAPH <urn:x-local:graph1> # Allocated when aliceFoaf read in GRAPH <urn:x-local:graph2> # Allocated when bobFoaf read in WHERE SOURCE ?snode (?person foaf:name ?name) (?snode dc:source ?source) (?snode dc:date ?date) and I get: ---------------------------------------------------------------------- | name | source | date | ====================================================================== | "Alice" | <http://example.org/foaf/graph> | "2005-01-10"^^xsd:date | | "BOB" | <http://example.org/foaf/graph> | "2005-01-10"^^xsd:date | | "Bob" | <http://example.org/foaf/graph> | "2004-12-06"^^xsd:date | | "Alice" | <http://example.org/foaf/graph> | "2004-12-06"^^xsd:date | ---------------------------------------------------------------------- then ==== Query 2 : PREFIX foaf: <http://xmlns.com/foaf/0.1/> PREFIX dc: <http://purl.org/dc/elements/1.1/> SELECT DISTINCT ?name ?source FROM <urn:x-local:details> GRAPH <urn:x-local:graph1> GRAPH <urn:x-local:graph2> WHERE SOURCE ?snode (?person foaf:name ?name) (?snode dc:source ?source) (?snode dc:date ?date) --------------------------------------------- | name | source | ============================================= | "BOB" | <http://example.org/foaf/graph> | | "Alice" | <http://example.org/foaf/graph> | | "Bob" | <http://example.org/foaf/graph> | --------------------------------------------- These put the provenance informatin in the unnamed graph but it could be placed in different named graph: ==== Query 3 : # Provence information in another named graph PREFIX foaf: <http://xmlns.com/foaf/0.1/> PREFIX dc: <http://purl.org/dc/elements/1.1/> SELECT DISTINCT ?name ?source GRAPH <urn:x-local:details> GRAPH <urn:x-local:graph1> GRAPH <urn:x-local:graph2> WHERE SOURCE ?snode (?person foaf:name ?name) SOURCE ?prov (?snode dc:source ?source) SOURCE ?prov (?snode dc:date ?date) results same as query 2: --------------------------------------------- | name | source | ============================================= | "Alice" | <http://example.org/foaf/graph> | | "BOB" | <http://example.org/foaf/graph> | | "Bob" | <http://example.org/foaf/graph> | --------------------------------------------- Query 3 shows that a system can manage different sets of assertions about named graphs at the same time. Andy
Received on Saturday, 15 January 2005 20:38:34 UTC