clerezza-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r...@apache.org
Subject [7/7] clerezza git commit: CLEREZZA-829:added test to make sure datatype is read correctly
Date Sat, 18 Apr 2015 09:48:59 GMT
CLEREZZA-829:added test to make sure datatype is read correctly

Project: http://git-wip-us.apache.org/repos/asf/clerezza/repo
Commit: http://git-wip-us.apache.org/repos/asf/clerezza/commit/b584894e
Tree: http://git-wip-us.apache.org/repos/asf/clerezza/tree/b584894e
Diff: http://git-wip-us.apache.org/repos/asf/clerezza/diff/b584894e

Branch: refs/heads/master
Commit: b584894e535bcdd3df064b02bf45f99258ddfd02
Parents: 83342fb
Author: Reto Gmuer <reto@apache.org>
Authored: Sat Apr 18 09:48:20 2015 +0000
Committer: Reto Gmuer <reto@apache.org>
Committed: Sat Apr 18 09:48:40 2015 +0000

----------------------------------------------------------------------
 .../rdf/jena/parser/JenaParserProviderTest.java         | 12 ++++++++++++
 .../org/apache/clerezza/rdf/jena/parser/test-05.nt      |  2 ++
 2 files changed, 14 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/clerezza/blob/b584894e/rdf/jena/parser/src/test/java/org/apache/clerezza/rdf/jena/parser/JenaParserProviderTest.java
----------------------------------------------------------------------
diff --git a/rdf/jena/parser/src/test/java/org/apache/clerezza/rdf/jena/parser/JenaParserProviderTest.java
b/rdf/jena/parser/src/test/java/org/apache/clerezza/rdf/jena/parser/JenaParserProviderTest.java
index 219c54e..ff777de 100644
--- a/rdf/jena/parser/src/test/java/org/apache/clerezza/rdf/jena/parser/JenaParserProviderTest.java
+++ b/rdf/jena/parser/src/test/java/org/apache/clerezza/rdf/jena/parser/JenaParserProviderTest.java
@@ -27,6 +27,8 @@ import org.apache.clerezza.rdf.core.serializedform.ParsingProvider;
 import org.apache.clerezza.commons.rdf.Graph;
 import org.apache.clerezza.commons.rdf.ImmutableGraph;
 import org.apache.clerezza.commons.rdf.IRI;
+import org.apache.clerezza.commons.rdf.Literal;
+import org.apache.clerezza.commons.rdf.Triple;
 import org.apache.clerezza.commons.rdf.impl.utils.simple.SimpleGraph;
 
 
@@ -49,6 +51,16 @@ public class JenaParserProviderTest {
         ImmutableGraph graphFromTurtle = parse(provider, turtleIn, "text/turtle", null);
         Assert.assertEquals(graphFromNTriples, graphFromTurtle);
     }
+    
+    @Test
+    public void testNTriplesDataType() {
+        ParsingProvider provider = new JenaParserProvider();
+        InputStream nTriplesIn = getClass().getResourceAsStream("test-05.nt");
+        ImmutableGraph graphFromNTriples = parse(provider, nTriplesIn, "application/n-triples",
null);
+        Assert.assertEquals(2, graphFromNTriples.size());
+        Triple t1 = graphFromNTriples.filter(null, new IRI("http://discobits.org/ontology#infoBit"),
null).next();
+        Assert.assertEquals(new IRI("http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral"),
((Literal)t1.getObject()).getDataType());
+    }
 
     /*
      * comparing result from nt and rdf/xml parsing,

http://git-wip-us.apache.org/repos/asf/clerezza/blob/b584894e/rdf/jena/parser/src/test/resources/org/apache/clerezza/rdf/jena/parser/test-05.nt
----------------------------------------------------------------------
diff --git a/rdf/jena/parser/src/test/resources/org/apache/clerezza/rdf/jena/parser/test-05.nt
b/rdf/jena/parser/src/test/resources/org/apache/clerezza/rdf/jena/parser/test-05.nt
new file mode 100644
index 0000000..0ecd1ae
--- /dev/null
+++ b/rdf/jena/parser/src/test/resources/org/apache/clerezza/rdf/jena/parser/test-05.nt
@@ -0,0 +1,2 @@
+<http://localhost:8080/getting-started/shell/content-el/3-title> <http://discobits.org/ontology#infoBit>
"Commands and Expressions"^^<http://www.w3.org/1999/02/22-rdf-syntax-ns#XMLLiteral>
.
+<http://localhost:8080/getting-started/shell/content-el/3-title> <http://www.w3.org/1999/02/22-rdf-syntax-ns#type>
<http://discobits.org/ontology#XHTMLInfoDiscoBit> .
\ No newline at end of file


Mime
View raw message