timrdf / pml

The Provenance Markup Language (PML 3.0) is an OWL ontology that extends W3C's PROV-O with the best parts of PML 2.0.
5 stars 1 forks source link

Reuse PROV-DICT for pml:Map? #11

Open timrdf opened 11 years ago

timrdf commented 11 years ago

From http://inference-web.org/wiki/IW_Meeting_2013-01-31

Latest draft is at https://dvcs.w3.org/hg/prov/raw-file/default/dictionary/prov-dictionary.html and is finalizing in a couple of weeks.

timrdf commented 11 years ago
Conceptually, a dictionary has a logical structure consisting of key-value pairs.
This structure is often referred to as a map

Example (with some of my added comments):

@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix xsd:  <http://www.w3.org/2001/XMLSchema#> .
@prefix owl:  <http://www.w3.org/2002/07/owl#> .
@prefix prov: <http://www.w3.org/ns/prov#> .
@prefix :     <http://example.com/> .

:our-old-baseball-team-field-positions
   a prov:Dictionary, 
         :FieldPositions;
      prov:hadDictionaryMember [  # I think we should just reuse prov:hadMember here.
         a prov:KeyValuePair;
         prov:pairKey "first-baseman"^^xsd:string; # No real need to type this.
         prov:pairValue :george; # This could have been handled with prov:entity, 
                                                # if prov:qualifiedMembership had survived.
      ],
      prov:hadDictionaryMember [
         a prov:KeyValuePair;
         prov:pairKey "pitcher"^^xsd:string;
         prov:pairValue :carl;
      ];
.

:george a prov:Entity .
:carl   a prov:Entity . 

Some trimming:

@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix xsd:  <http://www.w3.org/2001/XMLSchema#> .
@prefix owl:  <http://www.w3.org/2002/07/owl#> .
@prefix prov: <http://www.w3.org/ns/prov#> .
@prefix :     <http://example.com/> .

:our-old-baseball-team-field-positions
   a prov:Dictionary, 
      prov:hadMember [
         a prov:KeyValuePair;
         prov:pairKey "first-baseman";
         prov:pairValue :george;
      ], [
         a prov:KeyValuePair;
         prov:pairKey "pitcher";
         prov:pairValue :carl;
      ];
.

:george a prov:Entity .
:carl   a prov:Entity . 

It would have been nice if they reused the qualification pattern:

@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix xsd:  <http://www.w3.org/2001/XMLSchema#> .
@prefix owl:  <http://www.w3.org/2002/07/owl#> .
@prefix prov: <http://www.w3.org/ns/prov#> .
@prefix :     <http://example.com/> .

:our-old-baseball-team-field-positions
   a prov:Dictionary, prov:Collection;
      prov:hadMember :george, :carl; # Completely aligned with prov:Collection tooling.
   prov:qualifiedMembership [
         a prov:KeyValuePair;
         prov:pairKey "first-baseman";
         prov:entity :george; # Reused from qualification pattern.
      ], [
         a prov:KeyValuePair;
         prov:pairKey "pitcher";
         prov:entity :carl;  # Reused from qualification pattern.
      ];
.

:george a prov:Entity .
:carl   a prov:Entity .