restructuring PROV OWL assertions when performing owl:imports implementation.
authorTim L <lebot@rpi.edu>
Tue, 04 Oct 2011 12:20:54 -0400
changeset 471 c72b3adda675
parent 470 a82ed6b805e6
child 472 c14146f256c5
restructuring PROV OWL assertions when performing owl:imports implementation.
ontology/component-aggregations/aggregate.sh
ontology/component-aggregations/prov-variant-1.owl.prov.ttl
--- a/ontology/component-aggregations/aggregate.sh	Tue Oct 04 12:08:35 2011 -0400
+++ b/ontology/component-aggregations/aggregate.sh	Tue Oct 04 12:20:54 2011 -0400
@@ -19,7 +19,7 @@
 rm -f "_"`basename $0`*.tmp
 TEMP="_"`basename $0``date +%s`_$$.tmp
 
-for aggregation_file in `find . -name "*.ttl" | sed 's/^\.\///'`; do
+for aggregation_file in `find . -name "*.ttl" | grep -v ".prov.ttl" | sed 's/^\.\///'`; do
    aggregation_url="${base}/${aggregation_file}"
    echo "$aggregation_url"
    rm -f $TEMP
@@ -32,10 +32,19 @@
    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 "<$aggregated> prov:wasDerivedFrom <$aggregation_url> ."                                     >> $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
    rm -f $TEMP
 done
--- a/ontology/component-aggregations/prov-variant-1.owl.prov.ttl	Tue Oct 04 12:08:35 2011 -0400
+++ b/ontology/component-aggregations/prov-variant-1.owl.prov.ttl	Tue Oct 04 12:20:54 2011 -0400
@@ -1,4 +1,13 @@
+@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 :     <#> .
 
-<prov-variant-1.owl> prov:wasDerivedFrom <http://dvcs.w3.org/hg/prov/raw-file/tip/ontology/component-aggregations/prov-variant-1.ttl> .
-
+: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>;
+.