comments on simon's noteS
authorPaolo Missier <pmissier@acm.org>
Thu, 06 Oct 2011 16:01:54 +0200
changeset 559 4c79363beac1
parent 558 be0b753ed67c (current diff)
parent 557 3d6ec214ad01 (diff)
child 560 584e4c8e5807
comments on simon's noteS
--- a/ontology/component-aggregations/aggregate.sh	Thu Oct 06 15:57:11 2011 +0200
+++ b/ontology/component-aggregations/aggregate.sh	Thu Oct 06 16:01:54 2011 +0200
@@ -14,7 +14,7 @@
 #3>               doap:download-page <http://download.librdf.org/source/raptor2-1.9.1.tar.gz> ];
 #3> .
 
-base="http://dvcs.w3.org/hg/prov/raw-file/tip/ontology/component-aggregations"
+base="https://dvcs.w3.org/hg/prov/raw-file/tip/ontology/component-aggregations"
 
 if [ ! `which md5` ]; then
    echo "need md5 to proceed"
@@ -30,32 +30,56 @@
 rm -f "_"`basename $0`*.tmp
 TEMP="_"`basename $0``date +%s`_$$.tmp
 
-for aggregation_file in `find . -name "*.ttl" | grep -v "\.prov.ttl" | sed 's/^\.\///'`; do
-   aggregation_url="${base}/${aggregation_file}"
-   echo "$aggregation_url"
+for component_list_file in `find . -name "*.ttl" | grep -v "\.prov.ttl" | sed 's/^\.\///'`; do
    rm -f $TEMP
-   for component in `rapper -g -o ntriples $aggregation_url 2> /dev/null | awk '$2 == "<http://www.w3.org/2002/07/owl#imports>"{print $3}' | sed 's/<//;s/>//'`; do
+   component_url="${base}/${component_list_file}"
+   echo "$component_url"
+   closure_file=`echo $component_list_file | sed 's/.ttl$/.owl/'`
+
+   if [ "$closure_file" == $component_list_file ]; then
+      echo "skipping $component_list_file because it would be overwritten by its closure."
+      continue
+   fi
+
+   let input_count=0
+   for component in `rapper -g -o ntriples $component_url 2> /dev/null | awk '$2 == "<http://www.w3.org/2002/07/owl#imports>"{print $3}' | sed 's/<//;s/>//'`; do
+      let input_count=$input_count+1
       genid=`md5 -s $component | awk '{print $4}'`
       echo "   += $component"
       rapper -q -g -o ntriples $component | sed "s/_:genid/_:genid${genid}/g" >> $TEMP
+      if [ $input_count -eq 1 ]; then
+         echo "@prefix nfo:  <http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#> ."                >> $closure_file.prov.ttl
+         echo "@prefix prov: <http://dvcs.w3.org/hg/prov/raw-file/tip/ontology/ProvenanceOntology.owl#> ." >> $closure_file.prov.ttl
+         echo "@prefix :     <#> ."                                                                        >> $closure_file.prov.ttl
+         id=""
+      else
+         id="_$input_count"
+      fi
+      echo ""                                                                                              >> $closure_file.prov.ttl
+      echo ":result"                                                                                       >> $closure_file.prov.ttl
+      if [ $input_count -eq 1 ]; then
+         echo "   nfo:fileURL <$closure_file>;"                                                            >> $closure_file.prov.ttl
+         echo "   prov:wasDerivedFrom :component_list;"                                                    >> $closure_file.prov.ttl
+      fi
+         echo "   prov:wasDerivedFrom :input$id;"                                                          >> $closure_file.prov.ttl
+      if [ $input_count -eq 1 ]; then
+         echo "   a prov:Entity;"                                                                          >> $closure_file.prov.ttl
+      fi
+      echo "."                                                                                             >> $closure_file.prov.ttl
+      if [ $input_count -eq 1 ]; then
+         echo ""                                                                                           >> $closure_file.prov.ttl
+         echo ":component_list"                                                                            >> $closure_file.prov.ttl
+         echo "   nfo:fileURL <$component_url>;"                                                           >> $closure_file.prov.ttl
+         echo "   a prov:Entity;"                                                                          >> $closure_file.prov.ttl
+         echo "."                                                                                          >> $closure_file.prov.ttl
+      fi
+      echo ""                                                                                              >> $closure_file.prov.ttl
+      echo ":input$id"                                                                                     >> $closure_file.prov.ttl
+      echo "   nfo:fileURL <$component>;"                                                                  >> $closure_file.prov.ttl
+      echo "   a prov:Entity;"                                                                             >> $closure_file.prov.ttl
+      echo "."                                                                                             >> $closure_file.prov.ttl
    done
-   aggregated=`echo $aggregation_file | sed 's/.ttl$/.owl/'`
-   if [[ "$aggregation" != "$aggregated" ]]; then
-      rapper -q -i ntriples -o rdfxml-abbrev $TEMP > $aggregated
-      echo "   ==-> $aggregated"
-      echo "@prefix nfo:  <http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#> ."                >> $aggregated.prov.ttl
-      echo "@prefix prov: <http://dvcs.w3.org/hg/prov/raw-file/tip/ontology/ProvenanceOntology.owl#> ." >> $aggregated.prov.ttl
-      echo "@prefix :     <#> ."                                                                        >> $aggregated.prov.ttl
-      echo ""                                                                                           >> $aggregated.prov.ttl
-      echo ":result"                                                                                    >> $aggregated.prov.ttl
-      echo "   a prov:Entity;"                                                                          >> $aggregated.prov.ttl
-      echo "   nfo:fileURL <$aggregated>;"                                                              >> $aggregated.prov.ttl
-      echo "   prov:wasDerivedFrom :input;"                                                             >> $aggregated.prov.ttl
-      echo "."                                                                                          >> $aggregated.prov.ttl
-      echo ":input"                                                                                     >> $aggregated.prov.ttl
-      echo "   a prov:Entity;"                                                                          >> $aggregated.prov.ttl
-      echo "   nfo:fileURL <$aggregation_url>;"                                                         >> $aggregated.prov.ttl
-      echo "."                                                                                          >> $aggregated.prov.ttl
-   fi
+   rapper -q -i ntriples -o rdfxml-abbrev $TEMP > $closure_file
+   echo "   ==-> $closure_file"
    rm -f $TEMP
 done
--- a/ontology/component-aggregations/prov-variant-1.owl.prov.ttl	Thu Oct 06 15:57:11 2011 +0200
+++ b/ontology/component-aggregations/prov-variant-1.owl.prov.ttl	Thu Oct 06 16:01:54 2011 +0200
@@ -1,104 +1,38 @@
-@prefix nfo:  <http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#> .
-@prefix prov: <http://dvcs.w3.org/hg/prov/raw-file/tip/ontology/ProvenanceOntology.owl#> .
-@prefix :     <#> .
-
-:result
-   a prov:Entity;
-   nfo:fileURL <prov-variant-1.owl>;
-   prov:wasDerivedFrom :input;
-.
-:input
-   a prov:Entity;
-   nfo:fileURL <http://dvcs.w3.org/hg/prov/raw-file/tip/ontology/component-aggregations/prov-variant-1.ttl>;
-.
-@prefix nfo:  <http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#> .
-@prefix prov: <http://dvcs.w3.org/hg/prov/raw-file/tip/ontology/ProvenanceOntology.owl#> .
-@prefix :     <#> .
-
-:result
-   a prov:Entity;
-   nfo:fileURL <prov-variant-1.owl>;
-   prov:wasDerivedFrom :input;
-.
-:input
-   a prov:Entity;
-   nfo:fileURL <http://dvcs.w3.org/hg/prov/raw-file/tip/ontology/component-aggregations/prov-variant-1.ttl>;
-.
-@prefix nfo:  <http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#> .
-@prefix prov: <http://dvcs.w3.org/hg/prov/raw-file/tip/ontology/ProvenanceOntology.owl#> .
-@prefix :     <#> .
-
-:result
-   a prov:Entity;
-   nfo:fileURL <prov-variant-1.owl>;
-   prov:wasDerivedFrom :input;
-.
-:input
-   a prov:Entity;
-   nfo:fileURL <http://dvcs.w3.org/hg/prov/raw-file/tip/ontology/component-aggregations/prov-variant-1.ttl>;
-.
 @prefix nfo:  <http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#> .
 @prefix prov: <http://dvcs.w3.org/hg/prov/raw-file/tip/ontology/ProvenanceOntology.owl#> .
 @prefix :     <#> .
 
 :result
+   nfo:fileURL <prov-variant-1.owl>;
+   prov:wasDerivedFrom :component_list;
+   prov:wasDerivedFrom :input;
    a prov:Entity;
-   nfo:fileURL <prov-variant-1.owl>;
-   prov:wasDerivedFrom :input;
 .
-:input
-   a prov:Entity;
-   nfo:fileURL <http://dvcs.w3.org/hg/prov/raw-file/tip/ontology/component-aggregations/prov-variant-1.ttl>;
-.
-@prefix nfo:  <http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#> .
-@prefix prov: <http://dvcs.w3.org/hg/prov/raw-file/tip/ontology/ProvenanceOntology.owl#> .
-@prefix :     <#> .
 
-:result
+:component_list
+   nfo:fileURL <https://dvcs.w3.org/hg/prov/raw-file/tip/ontology/component-aggregations/prov-variant-1.ttl>;
    a prov:Entity;
-   nfo:fileURL <prov-variant-1.owl>;
-   prov:wasDerivedFrom :input;
 .
+
 :input
+   nfo:fileURL <https://dvcs.w3.org/hg/prov/raw-file/tip/ontology/components/Account.ttl>;
    a prov:Entity;
-   nfo:fileURL <http://dvcs.w3.org/hg/prov/raw-file/tip/ontology/component-aggregations/prov-variant-1.ttl>;
 .
-@prefix nfo:  <http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#> .
-@prefix prov: <http://dvcs.w3.org/hg/prov/raw-file/tip/ontology/ProvenanceOntology.owl#> .
-@prefix :     <#> .
 
 :result
-   a prov:Entity;
-   nfo:fileURL <prov-variant-1.owl>;
-   prov:wasDerivedFrom :input;
+   prov:wasDerivedFrom :input_2;
 .
-:input
+
+:input_2
+   nfo:fileURL <https://dvcs.w3.org/hg/prov/raw-file/tip/ontology/components/EntityInRole.ttl>;
    a prov:Entity;
-   nfo:fileURL <http://dvcs.w3.org/hg/prov/raw-file/tip/ontology/component-aggregations/prov-variant-1.ttl>;
 .
-@prefix nfo:  <http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#> .
-@prefix prov: <http://dvcs.w3.org/hg/prov/raw-file/tip/ontology/ProvenanceOntology.owl#> .
-@prefix :     <#> .
 
 :result
-   a prov:Entity;
-   nfo:fileURL <prov-variant-1.owl>;
-   prov:wasDerivedFrom :input;
-.
-:input
-   a prov:Entity;
-   nfo:fileURL <http://dvcs.w3.org/hg/prov/raw-file/tip/ontology/component-aggregations/prov-variant-1.ttl>;
+   prov:wasDerivedFrom :input_3;
 .
-@prefix nfo:  <http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#> .
-@prefix prov: <http://dvcs.w3.org/hg/prov/raw-file/tip/ontology/ProvenanceOntology.owl#> .
-@prefix :     <#> .
 
-:result
+:input_3
+   nfo:fileURL <https://dvcs.w3.org/hg/prov/raw-file/tip/ontology/components/assumedBy.ttl>;
    a prov:Entity;
-   nfo:fileURL <prov-variant-1.owl>;
-   prov:wasDerivedFrom :input;
 .
-:input
-   a prov:Entity;
-   nfo:fileURL <http://dvcs.w3.org/hg/prov/raw-file/tip/ontology/component-aggregations/prov-variant-1.ttl>;
-.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ontology/component-aggregations/prov.owl	Thu Oct 06 16:01:54 2011 +0200
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="utf-8"?>
+<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
+  <ns1:ObjectProperty xmlns:ns1="http://www.w3.org/2002/07/owl#" rdf:about="http://dvcs.w3.org/hg/prov/raw-file/tip/ontology/ProvenanceOntology.owl#wasDerivedFrom">
+    <ns2:domain xmlns:ns2="http://www.w3.org/2000/01/rdf-schema#" rdf:resource="http://dvcs.w3.org/hg/prov/raw-file/tip/ontology/ProvenanceOntology.owl#Entity"/>
+    <ns3:label xmlns:ns3="http://www.w3.org/2000/01/rdf-schema#">wasDerivedFrom</ns3:label>
+    <ns4:range xmlns:ns4="http://www.w3.org/2000/01/rdf-schema#" rdf:resource="http://dvcs.w3.org/hg/prov/raw-file/tip/ontology/ProvenanceOntology.owl#Entity"/>
+  </ns1:ObjectProperty>
+</rdf:RDF>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ontology/component-aggregations/prov.owl.prov.ttl	Thu Oct 06 16:01:54 2011 +0200
@@ -0,0 +1,20 @@
+@prefix nfo:  <http://www.semanticdesktop.org/ontologies/2007/03/22/nfo#> .
+@prefix prov: <http://dvcs.w3.org/hg/prov/raw-file/tip/ontology/ProvenanceOntology.owl#> .
+@prefix :     <#> .
+
+:result
+   nfo:fileURL <prov.owl>;
+   prov:wasDerivedFrom :component_list;
+   prov:wasDerivedFrom :input;
+   a prov:Entity;
+.
+
+:component_list
+   nfo:fileURL <https://dvcs.w3.org/hg/prov/raw-file/tip/ontology/component-aggregations/prov.ttl>;
+   a prov:Entity;
+.
+
+:input
+   nfo:fileURL <https://dvcs.w3.org/hg/prov/raw-file/tip/ontology/components/wasDerivedFrom.ttl>;
+   a prov:Entity;
+.
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ontology/components/wasDerivedFrom.ttl	Thu Oct 06 16:01:54 2011 +0200
@@ -0,0 +1,11 @@
+@prefix owl:  <http://www.w3.org/2002/07/owl#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix time: <http://www.w3.org/2006/time#> .
+@prefix prov: <http://dvcs.w3.org/hg/prov/raw-file/tip/ontology/ProvenanceOntology.owl#> .
+
+prov:wasDerivedFrom
+   a owl:ObjectProperty;
+   rdfs:label "wasDerivedFrom";
+   rdfs:domain prov:Entity;
+   rdfs:range prov:Entity;
+.