Minor update to manifest creation
authorGregg Kellogg <gregg@kellogg-assoc.com>
Sat, 01 Sep 2012 22:10:00 -0600
changeset 123 e9cb6e6b95a3
parent 122 cf9789b86496
child 124 3bebc3236104
Minor update to manifest creation
microdata-rdf/tests/index.html
microdata-rdf/tests/manifest.ttl
microdata-rdf/tests/mk-manifest.rb
--- a/microdata-rdf/tests/index.html	Sat Sep 01 21:04:43 2012 -0600
+++ b/microdata-rdf/tests/index.html	Sat Sep 01 22:10:00 2012 -0600
@@ -85,8 +85,11 @@
   </script>
 </head>
 <body>
-<section id="abstract"><p>This document serves as the manifest describing [[MICRODATA-RDF]] tests to be used by
+<section id="abstract">
+  <p>This document serves as the manifest describing [[MICRODATA-RDF]] tests to be used by
     processor implementations claiming conformance.</p>
+  <p>Alternative versions of the test manifest can be found in <a href="manifest.ttl">Turtle</a>
+    and <a href="manifest.jsonld">JSON-LD</a>.</p>  
 </section>
 <section><h2>Running tests</h2>
   <p>Tests are described with individual HTML files containing microdata, which when processed,
--- a/microdata-rdf/tests/manifest.ttl	Sat Sep 01 21:04:43 2012 -0600
+++ b/microdata-rdf/tests/manifest.ttl	Sat Sep 01 22:10:00 2012 -0600
@@ -5,108 +5,94 @@
 
 <> <http://www.w3.org/ns/md#item> ([ a mf:Manifest;
        rdfs:comment "Positive processor tests";
-       mf:entries [ a mf:ManifestEntry;
-         rdfs:comment "Item with no itemtype and literal itemprop";
-         mf:action [ a mq:QueryTest;
-           mq:data <0001.html>;
-           mq:query <0001.ttl>];
-         mf:name "Test 0001";
-         mf:result "true"],
-         [ a mf:ManifestEntry;
-         rdfs:comment "Item with no itemtype and 2 elements with equivalent itemprop";
-         mf:action [ a mq:QueryTest;
-           mq:data <0002.html>;
-           mq:query <0002.ttl>];
-         mf:name "Test 0002";
-         mf:result "true"],
-         [ a mf:ManifestEntry;
-         rdfs:comment "Item with itemprop having two properties";
-         mf:action [ a mq:QueryTest;
-           mq:data <0003.html>;
-           mq:query <0003.ttl>];
-         mf:name "Test 0003";
-         mf:result "true"],
-         [ a mf:ManifestEntry;
-         rdfs:comment "Use of meta and @content";
-         mf:action [ a mq:QueryTest;
-           mq:data <0004.html>;
-           mq:query <0004.ttl>];
-         mf:name "Test 0004";
-         mf:result "true"],
-         [ a mf:ManifestEntry;
-         rdfs:comment "Use of audio and @src";
-         mf:action [ a mq:QueryTest;
-           mq:data <0005.html>;
-           mq:query <0005.ttl>];
-         mf:name "Test 0005";
-         mf:result "true"],
-         [ a mf:ManifestEntry;
-         rdfs:comment "Use of embed and @src";
-         mf:action [ a mq:QueryTest;
-           mq:data <0006.html>;
-           mq:query <0006.ttl>];
-         mf:name "Test 0006";
-         mf:result "true"],
-         [ a mf:ManifestEntry;
-         rdfs:comment "Use of iframe and @src";
-         mf:action [ a mq:QueryTest;
-           mq:data <0007.html>;
-           mq:query <0007.ttl>];
-         mf:name "Test 0007";
-         mf:result "true"],
-         [ a mf:ManifestEntry;
-         rdfs:comment "Use of img and @src";
-         mf:action [ a mq:QueryTest;
-           mq:data <0008.html>;
-           mq:query <0008.ttl>];
-         mf:name "Test 0008";
-         mf:result "true"],
-         [ a mf:ManifestEntry;
-         rdfs:comment "Use of source and @src";
-         mf:action [ a mq:QueryTest;
-           mq:data <0009.html>;
-           mq:query <0009.ttl>];
-         mf:name "Test 0009";
-         mf:result "true"],
-         [ a mf:ManifestEntry;
-         rdfs:comment "Use of track and @src";
-         mf:action [ a mq:QueryTest;
-           mq:data <0010.html>;
-           mq:query <0010.ttl>];
-         mf:name "Test 0010";
-         mf:result "true"],
-         [ a mf:ManifestEntry;
-         rdfs:comment "Use of video and @src";
-         mf:action [ a mq:QueryTest;
-           mq:data <0011.html>;
-           mq:query <0011.ttl>];
-         mf:name "Test 0011";
-         mf:result "true"],
-         [ a mf:ManifestEntry;
-         rdfs:comment "Use of a and @href";
-         mf:action [ a mq:QueryTest;
-           mq:data <0012.html>;
-           mq:query <0012.ttl>];
-         mf:name "Test 0012";
-         mf:result "true"],
-         [ a mf:ManifestEntry;
-         rdfs:comment "Use of area and @href";
-         mf:action [ a mq:QueryTest;
-           mq:data <0013.html>;
-           mq:query <0013.ttl>];
-         mf:name "Test 0013";
-         mf:result "true"],
-         [ a mf:ManifestEntry;
-         rdfs:comment "Use of link and @href";
-         mf:action [ a mq:QueryTest;
-           mq:data <0014.html>;
-           mq:query <0014.ttl>];
-         mf:name "Test 0014";
-         mf:result "true"],
-         [ a mf:ManifestEntry;
-         rdfs:comment "Use of object and @data";
-         mf:action [ a mq:QueryTest;
-           mq:data <0015.html>;
-           mq:query <0015.ttl>];
-         mf:name "Test 0015";
-         mf:result "true"]]) .
+       mf:entries ([ a mf:ManifestEntry;
+           rdfs:comment "Item with no itemtype and literal itemprop";
+           mf:action [ a mq:QueryTest;
+             mq:data <0001.html>;
+             mq:query <0001.ttl>];
+           mf:name "Test 0001";
+           mf:result "true"] [ a mf:ManifestEntry;
+           rdfs:comment "Item with no itemtype and 2 elements with equivalent itemprop";
+           mf:action [ a mq:QueryTest;
+             mq:data <0002.html>;
+             mq:query <0002.ttl>];
+           mf:name "Test 0002";
+           mf:result "true"] [ a mf:ManifestEntry;
+           rdfs:comment "Item with itemprop having two properties";
+           mf:action [ a mq:QueryTest;
+             mq:data <0003.html>;
+             mq:query <0003.ttl>];
+           mf:name "Test 0003";
+           mf:result "true"] [ a mf:ManifestEntry;
+           rdfs:comment "Use of meta and @content";
+           mf:action [ a mq:QueryTest;
+             mq:data <0004.html>;
+             mq:query <0004.ttl>];
+           mf:name "Test 0004";
+           mf:result "true"] [ a mf:ManifestEntry;
+           rdfs:comment "Use of audio and @src";
+           mf:action [ a mq:QueryTest;
+             mq:data <0005.html>;
+             mq:query <0005.ttl>];
+           mf:name "Test 0005";
+           mf:result "true"] [ a mf:ManifestEntry;
+           rdfs:comment "Use of embed and @src";
+           mf:action [ a mq:QueryTest;
+             mq:data <0006.html>;
+             mq:query <0006.ttl>];
+           mf:name "Test 0006";
+           mf:result "true"] [ a mf:ManifestEntry;
+           rdfs:comment "Use of iframe and @src";
+           mf:action [ a mq:QueryTest;
+             mq:data <0007.html>;
+             mq:query <0007.ttl>];
+           mf:name "Test 0007";
+           mf:result "true"] [ a mf:ManifestEntry;
+           rdfs:comment "Use of img and @src";
+           mf:action [ a mq:QueryTest;
+             mq:data <0008.html>;
+             mq:query <0008.ttl>];
+           mf:name "Test 0008";
+           mf:result "true"] [ a mf:ManifestEntry;
+           rdfs:comment "Use of source and @src";
+           mf:action [ a mq:QueryTest;
+             mq:data <0009.html>;
+             mq:query <0009.ttl>];
+           mf:name "Test 0009";
+           mf:result "true"] [ a mf:ManifestEntry;
+           rdfs:comment "Use of track and @src";
+           mf:action [ a mq:QueryTest;
+             mq:data <0010.html>;
+             mq:query <0010.ttl>];
+           mf:name "Test 0010";
+           mf:result "true"] [ a mf:ManifestEntry;
+           rdfs:comment "Use of video and @src";
+           mf:action [ a mq:QueryTest;
+             mq:data <0011.html>;
+             mq:query <0011.ttl>];
+           mf:name "Test 0011";
+           mf:result "true"] [ a mf:ManifestEntry;
+           rdfs:comment "Use of a and @href";
+           mf:action [ a mq:QueryTest;
+             mq:data <0012.html>;
+             mq:query <0012.ttl>];
+           mf:name "Test 0012";
+           mf:result "true"] [ a mf:ManifestEntry;
+           rdfs:comment "Use of area and @href";
+           mf:action [ a mq:QueryTest;
+             mq:data <0013.html>;
+             mq:query <0013.ttl>];
+           mf:name "Test 0013";
+           mf:result "true"] [ a mf:ManifestEntry;
+           rdfs:comment "Use of link and @href";
+           mf:action [ a mq:QueryTest;
+             mq:data <0014.html>;
+             mq:query <0014.ttl>];
+           mf:name "Test 0014";
+           mf:result "true"] [ a mf:ManifestEntry;
+           rdfs:comment "Use of object and @data";
+           mf:action [ a mq:QueryTest;
+             mq:data <0015.html>;
+             mq:query <0015.ttl>];
+           mf:name "Test 0015";
+           mf:result "true"])]) .
--- a/microdata-rdf/tests/mk-manifest.rb	Sat Sep 01 21:04:43 2012 -0600
+++ b/microdata-rdf/tests/mk-manifest.rb	Sat Sep 01 22:10:00 2012 -0600
@@ -1,15 +1,26 @@
-#!/usr/bin/env ruby
 #!/usr/bin/env ruby
 require 'rdf/microdata'
+require 'rdf/turtle'
 require 'json/ld'
 
 graph = RDF::Graph.load("./index.html",
   :base_uri => "http://www.w3.org/TR/microdata-rdf/tests/",
-  :registry => "./test-registry.json")
+  :registry_uri => "./test-registry.json")
+
+# Turtle version
+RDF::Turtle::Writer.open("./manifest.ttl",
+  :base_uri => "http://www.w3.org/TR/microdata-rdf/tests/",
+  :prefixes => {
+    :rdfs => "http://www.w3.org/2000/01/rdf-schema#",
+    :mf => "http://www.w3.org/2001/sw/DataAccess/tests/test-manifest#",
+    :mq => "http://www.w3.org/2001/sw/DataAccess/tests/test-query#"}) do |w|
+  w << graph
+end
+
+# JSON-LD version
 JSON::LD::API.fromRDF(graph) do |expanded|
-  puts "expanded: #{expanded.to_json(JSON::LD::JSON_STATE)}"
   JSON::LD::API.frame(expanded, "./manifest-frame.jsonld") do |framed|
-    File.open("./index.jsonld", "w") do |f|
+    File.open("./manifest.jsonld", "w") do |f|
       f.write framed.to_json(JSON::LD::JSON_STATE)
     end
   end