added turtle versions of rdfxml examples
authorTim L <lebot@rpi.edu>
Wed, 07 Dec 2011 10:09:54 -0500
changeset 1188 7597b3a7546c
parent 1187 5d61106e19f7
child 1189 c02c3752d907
added turtle versions of rdfxml examples
bestpractices/BestPractices.html
--- a/bestpractices/BestPractices.html	Wed Dec 07 09:26:12 2011 -0500
+++ b/bestpractices/BestPractices.html	Wed Dec 07 10:09:54 2011 -0500
@@ -143,10 +143,10 @@
 
 <div class="buttonpanel"> 
 <form action="#"><p> 
-<input id="hide-examples" onclick="set_display_by_class('div','anexample rdfxml','none'); set_display_by_id('hide-examples','none'); set_display_by_id('show-examples','');" type="button" value="Hide Examples RDF" /> 
-<input id="show-examples" onclick="set_display_by_class('div','anexample rdfxml',''); set_display_by_id('hide-examples',''); set_display_by_id('show-examples','none');" style="display: none" type="button" value="Show Examples RDF" /> 
-<input id="hide-examples-ttl" onclick="set_display_by_class('div','anexample turtle','none'); set_display_by_id('hide-examples-ttl','none');  set_display_by_id('show-examples-ttl','');" type="button" value="Hide Examples TTL" /> 
-<input id="show-examples-ttl" onclick="set_display_by_class('div','anexample turtle',''); set_display_by_id('hide-examples-ttl','');  set_display_by_id('show-examples-ttl','none');" style="display: none" type="button" value="Show Examples TTL" /> 
+<input id="hide-examples" onclick="set_display_by_class('div','anexample rdfxml','none'); set_display_by_id('hide-examples','none'); set_display_by_id('show-examples','');" type="button" value="Hide Example RDF/XML" /> 
+<input id="show-examples" onclick="set_display_by_class('div','anexample rdfxml',''); set_display_by_id('hide-examples',''); set_display_by_id('show-examples','none');" style="display: none" type="button" value="Show Example RDF/XML" /> 
+<input id="hide-examples-ttl" onclick="set_display_by_class('div','anexample turtle','none'); set_display_by_id('hide-examples-ttl','none');  set_display_by_id('show-examples-ttl','');" type="button" value="Hide Example Turtle" /> 
+<input id="show-examples-ttl" onclick="set_display_by_class('div','anexample turtle',''); set_display_by_id('hide-examples-ttl','');  set_display_by_id('show-examples-ttl','none');" style="display: none" type="button" value="Show Example Turtle" /> 
 </p> 
 </form> 
 </div> 
@@ -178,8 +178,9 @@
                 &lt;?xml version="1.0"?&gt;
                 &lt;rdf:RDF
                     xmlns:xsd="http://www.w3.org/2001/XMLSchema#"
+                    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" 
+                    xmlns:time="http://www.w3.org/2006/time#" 
                     xmlns:prov="http://www.w3.org/ns/prov-o/"
-                    xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" 
                     xmlns:cf="http://www.example.com/crime#"&gt; 
 
                     &lt;rdf:Description rdf:about="http://www.example.com/crimeFile#e2"&gt;
@@ -235,7 +236,50 @@
 		<div class="anexample turtle">
 			<div class="exampleOuter">
 				<pre class="example">
-				  TODO Turtle
+@prefix rdf:  &lt;http://www.w3.org/1999/02/22-rdf-syntax-ns#&gt; .
+@prefix xsd:  &lt;http://www.w3.org/2001/XMLSchema#&gt; .
+@prefix time: &lt;http://www.w3.org/2006/time#&gt; .
+@prefix prov: &lt;http://www.w3.org/ns/prov-o/&gt; .
+
+@prefix cf:   &lt;http://www.example.com/crime#&gt; .
+@prefix :     &lt;http://www.example.com/crimeFile#&gt; .
+
+:Bob
+    a cf:Journalist .
+
+:e2
+    a cf:CrimeFile, prov:Entity ;
+    cf:hasFileContent "There was a lot of crime in London last month."^^xsd:string ;
+    cf:hasLocation      :sharedDirectoryLocation1 ;
+    prov:wasDerivedFrom :e1 ;
+    prov:wasGeneratedAt :t2 ;
+    prov:wasGeneratedBy :pe1 .
+
+:pe1
+    a cf:FileAppending, prov:Activity ;
+    prov:endedAt         :t3 ;
+    prov:startedAt       :t1 ;
+    prov:wasControlledBy :Bob .
+
+:pe2
+    a prov:Activity ;
+    prov:used :e2 .
+
+:sharedDirectoryLocation1
+    a prov:Location;
+    cf:hasFilePath "/share/crime.txt"^^xsd:string .
+
+:t1
+    a time:Instant ;
+    time:inXSDDateTime "2011-10-20T16:26:45Z" .
+
+:t2
+    a time:Instant ;
+    time:inXSDDateTime "2011-10-20T17:14:12Z" .
+
+:t3
+    a time:Instant ;
+    time:inXSDDateTime "2011-11-21T18:36:52Z" .
 				</pre>
 			</div>
 		</div>
@@ -257,7 +301,12 @@
 		<div class="anexample turtle">
 			<div class="exampleOuter">
 				<pre class="example">
-				  TODO Turtle
+@prefix rdfs: &lt;http://www.w3.org/2000/01/rdf-schema#&gt; .
+@prefix prov: &lt;http://www.w3.org/ns/prov-o/&gt; .
+
+&lt;http://www.example.com/crime#Journalist&gt; 
+   rdfs:subClassOf prov:Agent
+.
 				</pre>
 			</div>
 		</div>
@@ -278,7 +327,12 @@
 		<div class="anexample turtle">
 			<div class="exampleOuter">
 				<pre class="example">
-				  TODO Turtle
+@prefix rdfs: &lt;http://www.w3.org/2000/01/rdf-schema#&gt; .
+@prefix prov: &lt;http://www.w3.org/ns/prov-o/&gt; .
+
+&lt;http://www.example.com/crime#CrimeFile&gt;
+   rdfs:subClassOf prov:Entity
+.
 				</pre>
 			</div>
 		</div>
@@ -305,7 +359,12 @@
 		<div class="anexample turtle">
 			<div class="exampleOuter">
 				<pre class="example">
-				  TODO Turtle
+@prefix rdfs: &lt;http://www.w3.org/2000/01/rdf-schema#&gt; .
+@prefix prov: &lt;http://www.w3.org/ns/prov-o/&gt; .
+
+&lt;http://www.example.com/crime#FileCreation&gt;
+   rdfs:subClassOf prov:Activity
+.
 				</pre>
 			</div>
 		</div>
@@ -342,7 +401,12 @@
 		<div class="anexample turtle">
 			<div class="exampleOuter">
 				<pre class="example">
-				  TODO Turtle
+@prefix rdfs: &lt;http://www.w3.org/2000/01/rdf-schema#&gt; .
+@prefix prov: &lt;http://www.w3.org/ns/prov-o/&gt; .
+
+&lt;http://www.example.com/crime#hadFilePath&gt;
+   rdfs:subPropertyOf prov:hadLocation
+.
 				</pre>
 			</div>
 		</div>
@@ -830,7 +894,136 @@
 		<div class="anexample turtle">
 			<div class="exampleOuter">
 				<pre class="example">
-				  TODO Turtle
+@prefix prov: &lt;http://www.w3.org/ns/prov-o/&gt; .
+@prefix time: &lt;http://www.w3.org/2006/time#&gt; .
+@prefix foaf: &lt;http://xmlns.com/foaf/0.1/&gt; .
+
+@prefix wf:   &lt;http://www.example.com/scientific-workflow#&gt; .
+@prefix run:  &lt;http://www.example.com/run1#&gt; .
+@prefix :     &lt;http://example.com/aWorkflow&gt; .
+
+:workflowRun
+    a wf:Process ;
+    wf:wasDefinedBy &lt;http://www.example.com/workflow1#workflow&gt; ;
+    wf:usedValue [
+        a prov:Usage ;
+        wf:sawValue   :input ;
+        wf:seenAtPort &lt;http://www.example.com/workflow1#inName&gt; ;
+        prov:hadTemporalValue [
+            time:inDateTimeXSD "2011-10-21T09:21:31Z"
+        ]
+    ] ;
+    wf:generatedValue [
+        a prov:Generation
+        wf:sawValue :sha1FromWorkflow ;
+        wf:wasSeenAt &lt;http://www.example.com/workflow1#sha1&gt; ;
+    ] ;
+    wf:ranInWorkflowEngine :workflowEngine ;
+    wf:wasLaunchedBy :aUser ;
+    prov:endedAt [
+        time:inDateTimeXSD "2011-10-21T09:23:32Z"
+    ] ;
+    prov:startedAt [
+        time:inDateTimeXSD "2011-10-21T09:20:15Z"
+    ] .
+
+:aUser
+    a prov:Agent, foaf:Person ;
+    foaf:name "Stian Soiland-Reyes" .
+
+:combine
+    a wf:Process ;
+    wf:generatedValue [
+        a prov:Generation
+        wf:sawValue :combined ;
+        wf:seenAtPort &lt;http://www.example.com/workflow1#catOut&gt; ;
+    ] ;
+    wf:usedValue [
+        a prov:Usage ;
+        wf:seenAtPort &lt;http://www.example.com/workflow1#catIn1&gt; ;
+        prov:hadQualifiedEntity :hello ;
+        prov:hadTemporalValue [
+            time:inDateTimeXSD "2011-10-21T09:20:21Z"
+        ]
+    ], [
+        a prov:Usage ;
+        wf:sawValue   :input ;
+        wf:seenAtPort &lt;http://www.example.com/workflow1#catIn2&gt; ;
+        prov:hadTemporalValue [
+            time:inDateTimeXSD "2011-10-21T09:20:23Z"
+        ]
+    ] ;
+    wf:wasDefinedBy &lt;http://www.example.com/workflow1#cat&gt; ;
+    wf:wasSubProcessExecutionOf :workflowRun ;
+    prov:endedAt [
+        time:inDateTimeXSD "2011-10-21T09:20:25Z"
+    ] ;
+    prov:startedAt [
+        time:inDateTimeXSD "2011-10-21T09:20:20Z"
+    ] .
+
+:combined
+    wf:value "Hello, Steve" ;
+    a wf:Value .
+
+:constant
+    wf:generatedValue [
+        a prov:Generation ;
+        wf:sawValue &lt;http://www.example.com/workflow1#String_Constant_value&gt; ;
+        prov:hadQualifiedEntity :hello ;
+        prov:hadTemporalValue   :t0
+    ] ;
+    wf:wasDefinedBy &lt;http://www.example.com/workflow1#String_Constant&gt; ;
+    wf:wasSubProcessExecutionOf :workflowRun ;
+    a wf:Process ;
+    prov:endedAt   :t0 ;
+    prov:startedAt :t0 .
+
+:hello
+    wf:value "Hello, " ;
+    a wf:Value .
+
+:input
+    wf:value "Steve" ;
+    wf:wasReadFrom :inputFile ;
+    a wf:Value .
+
+:inputFile
+    wf:file "/tmp/myinput.txt" ;
+    wf:value "Steve" ;
+    a wf:FileValue .
+
+:sha1
+    wf:value "a33d1fb1658d4fbf017de59ab67437a3eb5ff50d" ;
+    a wf:Value .
+
+:sha1FromWorkflow
+    wf:sameValueAs :sha1 ;
+    wf:value "a33d1fb1658d4fbf017de59ab67437a3eb5ff50d" ;
+    a wf:Value .
+
+:shasum
+    a wf:Process ;
+    wf:generatedValue [
+        wf:sawValue :sha1 ;
+        wf:wasSeenAt &lt;http://www.example.com/workflow1#shaOut&gt; ;
+        a prov:Generation
+    ] ;
+    wf:wasDefinedBy &lt;http://www.example.com/workflow1#shasum&gt; ;
+    wf:wasSubProcessExecutionOf :workflowRun ;
+    prov:endedAt [
+        time:inDateTimeXSD "2011-10-21T09:21:00Z"
+    ] ;
+    prov:startedAt [
+        time:inDateTimeXSD "2011-10-21T09:20:30Z"
+    ] .
+
+:t0
+    a time:Instant ;
+    time:inDateTimeXSD "2011-10-21T09:20:15Z" .
+
+:workflowEngine
+    a wf:WorkflowEngine .
 				</pre>
 			</div>
 		</div>