Re: dataset syntax metadata

On 9/27/2012 5:23 AM, Antoine Zimmermann wrote:
> Lee,
>
>
> Le 26/09/2012 18:50, Lee Feigenbaum a écrit :
>> I'm not sure if this is at all helpful input, but here's how we handle
>> metadata -- in general -- in Anzo. Pat, you may avert your eyes because
>> the semantics are inconsistent at best.
>
> There is no accepted semantics for dataset, so your safe with
> consistency at the moment.
>
> BTW, the semantics at:
> http://www.w3.org/2011/rdf-wg/wiki/TF-Graphs/Minimal-dataset-semantics
> and at
> http://www.w3.org/2011/rdf-wg/wiki/index.php?title=TF-Graphs/Minimal-dataset-semantics&oldid=2438
>
> and at
> http://www.w3.org/2011/rdf-wg/wiki/TF-Graphs/RDF-Datasets-Proposal#Semantics
>
>
> all make your datasets consistent.

Nifty :)

>>
>> A couple of "regular" named graphs
>>
>> <p1> { <p1> a ex:Person ; foaf:name "Lee" ... }
>> <p2> { <p2> a ex:Person ; foaf:name "Lynn" ... }
>>
>> Named graphs have corresponding "metadata" graphs
>>
>> <mdg1> { <mdg1> a anzo:MetadataGraph . <p1> a anzo:NamedGraph ;
>> anzo:hasMetadataGraph <mdg1> ; anzo:createdBy ... ; anzo:lastModifiedBy
>> ... ; anzo:lastModifiedAt ... ; ... }
>> <mdg2> { <mdg2> a anzo:MetadataGraph . <p2> a anzo:NamedGraph ;
>> anzo:hasMetadataGraph <mdg2> ; anzo:createdBy ... ; anzo:lastModifiedBy
>> ... ; anzo:lastModifiedAt ... ; ... }
>>
>> We also have first-class datasets, that are represented roughly like:
>>
>> <ds1> { <ds1> a anzo:Dataset ; anzo:hasDefaultGraph <p1> ;
>> anzo:hasNamedGraph <p1>, <p2> }
>>
>> Of course, <ds1> is also a regular named graph, so there's a
>> corresponding metadata graph with metadata about the dataset:
>>
>> <mdg3> { <mdg3> a anzo:MetadataGraph . <ds1> a anzo:NamedGraph ;
>> anzo:hasMetadataGraph <mdg3> ; anzo:createdBy ... ; anzo:lastModifiedBy
>> ... ; anzo:lastModifiedAt ... ; ... }
>>
>> Among other things, we use these datasets directly within SPARQL by
>> extending SPARQL with a FROM DATASET clause:
>>
>> SELECT ...
>> FROM DATASET <ds1>
>> WHERE { ... }
>>
>> ...which would be equivalent in this example to
>>
>> SELECT ...
>> FROM <p1>
>> FROM NAMED <p1>
>> FROM NAMED <p2>
>> WHERE { ... }
>>
>> When we import TriG, we generally are just doing either a replace or an
>> add on the data in the named graphs in the TriG file. We generally don't
>> automatically create anzo:Dataset's based on the contents of a
>> particular TriG file. Instead, if we were exporting and then importing a
>> dataset, we'd just include the <ds1> graph in our export so we'd have it
>> back again in an import in the future.
>>
>> Regarding your question (a), Sandro, you can always find the metadata
>> graph for a particular graph (including a dataset graph) simply by
>> querying for the anzo:hasMetadataGraph triple.
>
> How would you do that? If I do:
>
> SELECT ?mdg WHERE {
>    ?mdg  a  anzo:hasMetadataGraph .
> }
>
> this should query the default graph, which is non existent, or defined
> specifically per datasets. So how does it work exactly?

A couple of possible ways. Though we don't usually do it, I believe the 
system can be configured so that the default graph _for queries_ when no 
other dataset is specified is the union of all graphs (as many other 
systems do). There's also a system-maintained dataset with a well-known 
URI that automagically contains all graphs so you can use that (FROM 
DATASET <ex:allgraphs>).

Lee

>
> <skip/>
>

Received on Thursday, 27 September 2012 12:03:06 UTC