Added test vocabulary definition for useRdfType.
Added fromRdf-0019 to test useRdfType.
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/fromRdf-0019-in.nq Tue Oct 01 13:05:41 2013 -0700
@@ -0,0 +1,5 @@
+<http://example.com/Subj1> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://example.com/Type> .
+<http://example.com/Subj1> <http://example.com/prop1> <http://example.com/Obj1> .
+<http://example.com/Subj1> <http://example.com/prop2> "Plain" .
+<http://example.com/Subj1> <http://example.com/prop2> "2012-05-12"^^<http://www.w3.org/2001/XMLSchema#date> .
+<http://example.com/Subj1> <http://example.com/prop2> "English"@en .
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/test-suite/tests/fromRdf-0019-out.jsonld Tue Oct 01 13:05:41 2013 -0700
@@ -0,0 +1,14 @@
+[
+ {
+ "@id": "http://example.com/Subj1",
+ "http://example.com/prop1": [{"@id": "http://example.com/Obj1"}],
+ "http://example.com/prop2": [
+ {"@value": "Plain"},
+ {"@value": "2012-05-12", "@type": "http://www.w3.org/2001/XMLSchema#date"},
+ {"@value": "English", "@language": "en"}
+ ],
+ "http://www.w3.org/1999/02/22-rdf-syntax-ns#type": [
+ {"@id": "http://example.com/Type"}
+ ]
+ }
+]
--- a/test-suite/tests/fromRdf-manifest.jsonld Mon Sep 30 11:38:49 2013 -0700
+++ b/test-suite/tests/fromRdf-manifest.jsonld Tue Oct 01 13:05:41 2013 -0700
@@ -135,6 +135,16 @@
},
"input": "fromRdf-0018-in.nq",
"expect": "fromRdf-0018-out.jsonld"
+ }, {
+ "@id": "#t0019",
+ "@type": ["jld:PositiveEvaluationTest", "jld:FromRDFTest"],
+ "name": "use RDF type set to false",
+ "purpose": "Seting useRdfType to false causes an rdf:type predicate to be treated like a normal property, not @type",
+ "option": {
+ "useRdfType": false
+ },
+ "input": "fromRdf-0019-in.nq",
+ "expect": "fromRdf-0019-out.jsonld"
}
]
}
--- a/test-suite/vocab.html Mon Sep 30 11:38:49 2013 -0700
+++ b/test-suite/vocab.html Tue Oct 01 13:05:41 2013 -0700
@@ -342,6 +342,22 @@
<code property='rdfs:range' resource='xsd:boolean'>xsd:boolean</code>
</div>
</dd>
+ <dt about='jld:useRdfType' property='rdfs:label' typeof='rdfs:Property'>use RDF types</dt>
+ <dd about='jld:useRdfType'>
+ <span property='rdfs:comment'><p>If the <em>use rdf type</em> flag is set to <code>true</code>, statements with an <code>rdf:type</code> predicate will not use <code>@type</code>, but will be transformed as a normal property.</p></span>
+ <div>
+ <strong>
+ domain:
+ </strong>
+ <code property='rdfs:domain' resource='jld:FromRDFTest'>jld:FromRDFTest</code>
+ </div>
+ <div>
+ <strong>
+ range:
+ </strong>
+ <code property='rdfs:range' resource='xsd:boolean'>xsd:boolean</code>
+ </div>
+ </dd>
<dt about='jld:useDocumentLoader' property='rdfs:label' typeof='rdfs:Property'>use document loader</dt>
<dd about='jld:useDocumentLoader'>
<span property='rdfs:comment'><p>Test runners must implement a callback method with a method signature as defined in <a href="http://json-ld.org/spec/latest/json-ld-api/index.html#idl-def-LoadDocumentCallback">LoadDocumentCallback</a>. Specifying this option requires the test runner to provide this callback to the appropriate API method using the <code>documentLoader</code> option.</p></span>
--- a/test-suite/vocab.jsonld Mon Sep 30 11:38:49 2013 -0700
+++ b/test-suite/vocab.jsonld Tue Oct 01 13:05:41 2013 -0700
@@ -218,6 +218,14 @@
"rdfs:domain": "jld:FromRDFTest",
"rdfs:label": "use native types",
"rdfs:range": "xsd:boolean"
+ },
+ {
+ "@id": "jld:useRdfType",
+ "@type": "rdfs:Property",
+ "rdfs:comment": "If the _use rdf type_ flag is set to `true`, statements with an `rdf:type` predicate will not use `@type`, but will be transformed as a normal property.",
+ "rdfs:domain": "jld:FromRDFTest",
+ "rdfs:label": "use RDF types",
+ "rdfs:range": "xsd:boolean"
}
]
}
\ No newline at end of file
--- a/test-suite/vocab.ttl Mon Sep 30 11:38:49 2013 -0700
+++ b/test-suite/vocab.ttl Tue Oct 01 13:05:41 2013 -0700
@@ -244,6 +244,15 @@
rdfs:domain :FromRDFTest ;
rdfs:range xsd:boolean .
+:useRdfType a rdfs:Property ;
+ rdfs:label "use RDF types";
+ rdfs:comment """
+ If the _use rdf type_ flag is set to `true`, statements with an `rdf:type` predicate
+ will not use `@type`, but will be transformed as a normal property.
+ """ ;
+ rdfs:domain :FromRDFTest ;
+ rdfs:range xsd:boolean .
+
:contentType a rdfs:Property ;
rdfs:label "content type";
rdfs:comment """