You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@marmotta.apache.org by ja...@apache.org on 2013/02/21 16:30:44 UTC
[47/55] MARMOTTA-106: renamed sesame-rio modules
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/21a28cf8/commons/sesame-tools-rio-jsonld/src/main/java/org/apache/marmotta/commons/sesame/rio/jsonld/JsonLdParser.java
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/main/java/org/apache/marmotta/commons/sesame/rio/jsonld/JsonLdParser.java b/commons/sesame-tools-rio-jsonld/src/main/java/org/apache/marmotta/commons/sesame/rio/jsonld/JsonLdParser.java
new file mode 100644
index 0000000..9c83d26
--- /dev/null
+++ b/commons/sesame-tools-rio-jsonld/src/main/java/org/apache/marmotta/commons/sesame/rio/jsonld/JsonLdParser.java
@@ -0,0 +1,200 @@
+/**
+ * Copyright (C) 2013 Salzburg Research.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.marmotta.commons.sesame.rio.jsonld;
+
+import com.google.common.base.Preconditions;
+import de.dfki.km.json.jsonld.JSONLDProcessor;
+import de.dfki.km.json.jsonld.JSONLDTripleCallback;
+import org.codehaus.jackson.map.ObjectMapper;
+import org.codehaus.jackson.type.TypeReference;
+import org.openrdf.OpenRDFException;
+import org.openrdf.model.URI;
+import org.openrdf.model.Value;
+import org.openrdf.model.ValueFactory;
+import org.openrdf.rio.RDFFormat;
+import org.openrdf.rio.RDFHandlerException;
+import org.openrdf.rio.RDFParseException;
+import org.openrdf.rio.helpers.RDFParserBase;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.Reader;
+import java.util.Map;
+
+/**
+ * Add file description here!
+ * <p/>
+ * Author: Sebastian Schaffert
+ */
+public class JsonLdParser extends RDFParserBase implements JSONLDTripleCallback {
+
+ private static Logger log = LoggerFactory.getLogger(JsonLdParser.class);
+
+ JSONLDProcessor processor;
+
+ /**
+ * Creates a new RDFParserBase that will use a {@link org.openrdf.model.impl.ValueFactoryImpl} to
+ * create RDF model objects.
+ */
+ public JsonLdParser() {
+ processor = new JSONLDProcessor();
+ }
+
+ /**
+ * Creates a new RDFParserBase that will use the supplied ValueFactory to
+ * create RDF model objects.
+ *
+ * @param valueFactory A ValueFactory.
+ */
+ public JsonLdParser(ValueFactory valueFactory) {
+ super(valueFactory);
+ processor = new JSONLDProcessor();
+ }
+
+ /**
+ * Gets the RDF format that this parser can parse.
+ */
+ @Override
+ public RDFFormat getRDFFormat() {
+ return RDFFormat.JSONLD;
+ }
+
+ /**
+ * Parses the data from the supplied InputStream, using the supplied baseURI
+ * to resolve any relative URI references.
+ *
+ * @param in The InputStream from which to read the data.
+ * @param baseURI The URI associated with the data in the InputStream.
+ * @throws java.io.IOException If an I/O error occurred while data was read from the InputStream.
+ * @throws org.openrdf.rio.RDFParseException
+ * If the parser has found an unrecoverable parse error.
+ * @throws org.openrdf.rio.RDFHandlerException
+ * If the configured statement handler has encountered an
+ * unrecoverable error.
+ */
+ @Override
+ public void parse(InputStream in, String baseURI) throws IOException, RDFParseException, RDFHandlerException {
+ if(baseURI != null)
+ setBaseURI(baseURI);
+
+ ObjectMapper mapper = new ObjectMapper();
+ Map<String,Object> object = mapper.readValue(in,new TypeReference<Map<String,Object>>() {});
+
+ try {
+ processor.triples(object,this);
+ } catch(IllegalArgumentException ex) {
+ if(ex.getCause() instanceof RDFParseException)
+ throw (RDFParseException)ex.getCause();
+ else {
+ throw new IllegalArgumentException(ex);
+ }
+ }
+ }
+
+ /**
+ * Parses the data from the supplied Reader, using the supplied baseURI to
+ * resolve any relative URI references.
+ *
+ * @param reader The Reader from which to read the data.
+ * @param baseURI The URI associated with the data in the InputStream.
+ * @throws java.io.IOException If an I/O error occurred while data was read from the InputStream.
+ * @throws org.openrdf.rio.RDFParseException
+ * If the parser has found an unrecoverable parse error.
+ * @throws org.openrdf.rio.RDFHandlerException
+ * If the configured statement handler has encountered an
+ * unrecoverable error.
+ */
+ @Override
+ public void parse(Reader reader, String baseURI) throws IOException, RDFParseException, RDFHandlerException {
+ if(baseURI != null)
+ setBaseURI(baseURI);
+
+ ObjectMapper mapper = new ObjectMapper();
+ Map<String,Object> object = mapper.readValue(reader,new TypeReference<Map<String,Object>>() {});
+
+ try {
+ processor.triples(object,this);
+ } catch(IllegalArgumentException ex) {
+ if(ex.getCause() instanceof RDFParseException)
+ throw (RDFParseException)ex.getCause();
+ else {
+ throw new IllegalArgumentException(ex);
+ }
+ }
+ }
+
+
+ /**
+ * Construct a triple with three URIs.
+ *
+ * @param s The Subject URI
+ * @param p The Predicate URI
+ * @param o The Object URI
+ * @return The generated triple, or null to force triple generation to stop
+ */
+ @Override
+ public void triple(String s, String p, String o) {
+ // This method is always called with three URIs as subject predicate and
+ // object
+ try {
+ rdfHandler.handleStatement(createStatement(resolveURI(s), resolveURI(p), resolveURI(o)));
+ } catch (OpenRDFException e) {
+ log.error("RDF Parse Error while creating statement",e);
+ throw new IllegalArgumentException("RDF Parse Error while creating statement",e);
+ }
+ }
+
+ /**
+ * Constructs a triple with a Literal object, which may or may not contain a
+ * language and/or a datatype.
+ *
+ * @param s The Subject URI
+ * @param p The Predicate URI
+ * @param value The literal value
+ * @param datatype The literal datatype
+ * @param language The literal language (NOTE: may be null if not specified!)
+ * @return The generated triple, or null to force triple generation to stop
+ */
+ @Override
+ public void triple(String s, String p, String value, String datatype, String language) {
+ Preconditions.checkNotNull(s);
+ Preconditions.checkNotNull(p);
+ Preconditions.checkNotNull(value);
+
+ try {
+ URI subject = createURI(s);
+
+ URI predicate = createURI(p);
+
+ Value object;
+ if (language != null) {
+ object = createLiteral(value, language, null);
+ } else if (datatype != null) {
+ object = createLiteral(value, null, createURI(datatype));
+ } else {
+ object = createLiteral(value, null, null);
+ }
+
+ rdfHandler.handleStatement(createStatement(subject, predicate, object));
+
+ } catch (OpenRDFException e) {
+ log.error("RDF Parse Error while creating statement",e);
+ throw new IllegalArgumentException("RDF Parse Error while creating statement",e);
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/21a28cf8/commons/sesame-tools-rio-jsonld/src/main/java/org/apache/marmotta/commons/sesame/rio/jsonld/JsonLdParserFactory.java
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/main/java/org/apache/marmotta/commons/sesame/rio/jsonld/JsonLdParserFactory.java b/commons/sesame-tools-rio-jsonld/src/main/java/org/apache/marmotta/commons/sesame/rio/jsonld/JsonLdParserFactory.java
new file mode 100644
index 0000000..01977cb
--- /dev/null
+++ b/commons/sesame-tools-rio-jsonld/src/main/java/org/apache/marmotta/commons/sesame/rio/jsonld/JsonLdParserFactory.java
@@ -0,0 +1,44 @@
+/**
+ * Copyright (C) 2013 Salzburg Research.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.marmotta.commons.sesame.rio.jsonld;
+
+import org.openrdf.rio.RDFFormat;
+import org.openrdf.rio.RDFParser;
+import org.openrdf.rio.RDFParserFactory;
+
+/**
+ * Add file description here!
+ * <p/>
+ * Author: Sebastian Schaffert
+ */
+public class JsonLdParserFactory implements RDFParserFactory {
+
+ /**
+ * Returns the RDF format for this factory.
+ */
+ @Override
+ public RDFFormat getRDFFormat() {
+ return RDFFormat.JSONLD;
+ }
+
+ /**
+ * Returns a RDFParser instance.
+ */
+ @Override
+ public RDFParser getParser() {
+ return new JsonLdParser();
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/21a28cf8/commons/sesame-tools-rio-jsonld/src/main/java/org/apache/marmotta/commons/sesame/rio/jsonld/JsonLdWriter.java
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/main/java/org/apache/marmotta/commons/sesame/rio/jsonld/JsonLdWriter.java b/commons/sesame-tools-rio-jsonld/src/main/java/org/apache/marmotta/commons/sesame/rio/jsonld/JsonLdWriter.java
new file mode 100644
index 0000000..94107d3
--- /dev/null
+++ b/commons/sesame-tools-rio-jsonld/src/main/java/org/apache/marmotta/commons/sesame/rio/jsonld/JsonLdWriter.java
@@ -0,0 +1,124 @@
+/**
+ * Copyright (C) 2013 Salzburg Research.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.marmotta.commons.sesame.rio.jsonld;
+
+import de.dfki.km.json.jsonld.impl.SesameJSONLDSerializer;
+import org.openrdf.model.Statement;
+import org.openrdf.rio.RDFFormat;
+import org.openrdf.rio.RDFHandlerException;
+import org.openrdf.rio.RDFWriter;
+
+import java.io.OutputStream;
+import java.io.OutputStreamWriter;
+import java.io.PrintWriter;
+import java.io.Writer;
+
+/**
+ * Add file description here!
+ * <p/>
+ * User: sschaffe
+ */
+public class JsonLdWriter implements RDFWriter {
+
+
+ private PrintWriter writer;
+
+ SesameJSONLDSerializer serializer;
+
+ public JsonLdWriter(OutputStream out) {
+ writer = new PrintWriter(new OutputStreamWriter(out));
+ serializer = new SesameJSONLDSerializer();
+ }
+
+
+ public JsonLdWriter(Writer writer) {
+ this.writer = new PrintWriter(writer);
+ serializer = new SesameJSONLDSerializer();
+ }
+
+
+ /**
+ * Gets the RDF format that this RDFWriter uses.
+ */
+ @Override
+ public RDFFormat getRDFFormat() {
+ return RDFFormat.JSONLD;
+ }
+
+ /**
+ * Signals the start of the RDF data. This method is called before any data
+ * is reported.
+ *
+ * @throws org.openrdf.rio.RDFHandlerException
+ * If the RDF handler has encountered an unrecoverable error.
+ */
+ @Override
+ public void startRDF() throws RDFHandlerException {
+ }
+
+ /**
+ * Signals the end of the RDF data. This method is called when all data has
+ * been reported.
+ *
+ * @throws org.openrdf.rio.RDFHandlerException
+ * If the RDF handler has encountered an unrecoverable error.
+ */
+ @Override
+ public void endRDF() throws RDFHandlerException {
+ writer.print(serializer.asString());
+ writer.flush();
+ }
+
+ /**
+ * Handles a namespace declaration/definition. A namespace declaration
+ * associates a (short) prefix string with the namespace's URI. The prefix
+ * for default namespaces, which do not have an associated prefix, are
+ * represented as empty strings.
+ *
+ * @param prefix The prefix for the namespace, or an empty string in case of a
+ * default namespace.
+ * @param uri The URI that the prefix maps to.
+ * @throws org.openrdf.rio.RDFHandlerException
+ * If the RDF handler has encountered an unrecoverable error.
+ */
+ @Override
+ public void handleNamespace(String prefix, String uri) throws RDFHandlerException {
+ serializer.setPrefix(uri,prefix);
+ }
+
+ /**
+ * Handles a statement.
+ *
+ * @param st The statement.
+ * @throws org.openrdf.rio.RDFHandlerException
+ * If the RDF handler has encountered an unrecoverable error.
+ */
+ @Override
+ public void handleStatement(Statement st) throws RDFHandlerException {
+ serializer.handleStatement(st);
+ }
+
+ /**
+ * Handles a comment.
+ *
+ * @param comment The comment.
+ * @throws org.openrdf.rio.RDFHandlerException
+ * If the RDF handler has encountered an unrecoverable error.
+ */
+ @Override
+ public void handleComment(String comment) throws RDFHandlerException {
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/21a28cf8/commons/sesame-tools-rio-jsonld/src/main/java/org/apache/marmotta/commons/sesame/rio/jsonld/JsonLdWriterFactory.java
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/main/java/org/apache/marmotta/commons/sesame/rio/jsonld/JsonLdWriterFactory.java b/commons/sesame-tools-rio-jsonld/src/main/java/org/apache/marmotta/commons/sesame/rio/jsonld/JsonLdWriterFactory.java
new file mode 100644
index 0000000..6319082
--- /dev/null
+++ b/commons/sesame-tools-rio-jsonld/src/main/java/org/apache/marmotta/commons/sesame/rio/jsonld/JsonLdWriterFactory.java
@@ -0,0 +1,60 @@
+/**
+ * Copyright (C) 2013 Salzburg Research.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.marmotta.commons.sesame.rio.jsonld;
+
+import org.openrdf.rio.RDFFormat;
+import org.openrdf.rio.RDFWriter;
+import org.openrdf.rio.RDFWriterFactory;
+
+import java.io.OutputStream;
+import java.io.Writer;
+
+/**
+ * Add file description here!
+ * <p/>
+ * Author: Sebastian Schaffert
+ */
+public class JsonLdWriterFactory implements RDFWriterFactory {
+
+ /**
+ * Returns the RDF format for this factory.
+ */
+ @Override
+ public RDFFormat getRDFFormat() {
+ return RDFFormat.JSONLD;
+ }
+
+ /**
+ * Returns an RDFWriter instance that will write to the supplied output
+ * stream.
+ *
+ * @param out The OutputStream to write the RDF to.
+ */
+ @Override
+ public RDFWriter getWriter(OutputStream out) {
+ return new JsonLdWriter(out);
+ }
+
+ /**
+ * Returns an RDFWriter instance that will write to the supplied writer.
+ *
+ * @param writer The Writer to write the RDF to.
+ */
+ @Override
+ public RDFWriter getWriter(Writer writer) {
+ return new JsonLdWriter(writer);
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/21a28cf8/commons/sesame-tools-rio-jsonld/src/main/resources/META-INF/services/org.openrdf.rio.RDFParserFactory
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/main/resources/META-INF/services/org.openrdf.rio.RDFParserFactory b/commons/sesame-tools-rio-jsonld/src/main/resources/META-INF/services/org.openrdf.rio.RDFParserFactory
index d97ec4e..7864661 100644
--- a/commons/sesame-tools-rio-jsonld/src/main/resources/META-INF/services/org.openrdf.rio.RDFParserFactory
+++ b/commons/sesame-tools-rio-jsonld/src/main/resources/META-INF/services/org.openrdf.rio.RDFParserFactory
@@ -1 +1 @@
-at.newmedialab.sesame.rio.jsonld.JsonLdParserFactory
\ No newline at end of file
+org.apache.marmotta.commons.sesame.rio.jsonld.JsonLdParserFactory
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/21a28cf8/commons/sesame-tools-rio-jsonld/src/test/java/TestJSONLdParser.java
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/java/TestJSONLdParser.java b/commons/sesame-tools-rio-jsonld/src/test/java/TestJSONLdParser.java
deleted file mode 100644
index 84d9c80..0000000
--- a/commons/sesame-tools-rio-jsonld/src/test/java/TestJSONLdParser.java
+++ /dev/null
@@ -1,102 +0,0 @@
-/*
- * Copyright (c) 2013 The Apache Software Foundation
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-import org.apache.commons.io.IOUtils;
-import org.junit.Test;
-import org.junit.runner.RunWith;
-import org.junit.runners.Parameterized;
-import org.openrdf.query.BooleanQuery;
-import org.openrdf.query.QueryLanguage;
-import org.openrdf.repository.Repository;
-import org.openrdf.repository.RepositoryConnection;
-import org.openrdf.repository.sail.SailRepository;
-import org.openrdf.rio.RDFFormat;
-import org.openrdf.sail.memory.MemoryStore;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-
-import java.io.InputStream;
-import java.util.ArrayList;
-import java.util.Arrays;
-import java.util.Collection;
-
-import static java.util.Arrays.asList;
-import static org.hamcrest.CoreMatchers.everyItem;
-import static org.hamcrest.CoreMatchers.notNullValue;
-import static org.junit.Assert.assertTrue;
-import static org.junit.Assert.fail;
-import static org.junit.Assume.assumeThat;
-
-/**
- * Add file description here!
- * <p/>
- * Author: Sebastian Schaffert
- */
-@RunWith(Parameterized.class)
-public class TestJSONLdParser {
-
- private static Logger log = LoggerFactory.getLogger(TestJSONLdParser.class);
-
- private String fileName;
-
- public TestJSONLdParser(String fileName) {
- this.fileName = fileName;
- }
-
- // return the list of rdf-NNNN.jsonld files
- @Parameterized.Parameters(name = "{0}")
- public static Collection<Object[]> data() {
- int[] skip = new int[] {1,2,8,9,10,11,12,14,15,16,17,18,21,22,25};
- ArrayList<Object[]> list = new ArrayList<Object[]>();
- for(int i=1; i<=26; i++) {
- if(Arrays.binarySearch(skip,i) == -1) {
- list.add(new Object[] {"rdf-"+String.format("%04d",i)});
- }
- }
- return list;
- }
-
-
- @Test
- public void runTest() throws Exception {
- log.info("running test {} ...", fileName);
-
- InputStream jsonLD = this.getClass().getResourceAsStream("testfiles/"+fileName+".jsonld");
- InputStream sparql = this.getClass().getResourceAsStream("testfiles/"+fileName+".sparql");
- assumeThat("Could not load testfiles", asList(jsonLD, sparql), everyItem(notNullValue(InputStream.class)));
-
- Repository repository = new SailRepository(new MemoryStore());
- repository.initialize();
-
- RepositoryConnection connection = repository.getConnection();
- try {
- connection.add(jsonLD,"http://localhost/jsonld/", RDFFormat.JSONLD);
- connection.commit();
- } catch(Exception ex) {
- fail("parsing "+fileName+" failed!");
- }
- assertTrue(connection.size() > 0);
-
- int count = connection.getStatements(null, null, null, false).asList().size();
- assertTrue(count > 0);
-
- BooleanQuery sparqlQuery = (BooleanQuery)connection.prepareQuery(QueryLanguage.SPARQL, IOUtils.toString(sparql));
- assertTrue("SPARQL query evaluation for "+fileName+" failed",sparqlQuery.evaluate());
-
- connection.close();
- repository.shutDown();
- }
-}
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/21a28cf8/commons/sesame-tools-rio-jsonld/src/test/java/org/apache/marmotta/commons/sesame/rio/jsonld/TestJSONLdParser.java
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/java/org/apache/marmotta/commons/sesame/rio/jsonld/TestJSONLdParser.java b/commons/sesame-tools-rio-jsonld/src/test/java/org/apache/marmotta/commons/sesame/rio/jsonld/TestJSONLdParser.java
new file mode 100644
index 0000000..ceaffa7
--- /dev/null
+++ b/commons/sesame-tools-rio-jsonld/src/test/java/org/apache/marmotta/commons/sesame/rio/jsonld/TestJSONLdParser.java
@@ -0,0 +1,103 @@
+package org.apache.marmotta.commons.sesame.rio.jsonld;
+/*
+ * Copyright (c) 2013 The Apache Software Foundation
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+import org.apache.commons.io.IOUtils;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+import org.junit.runners.Parameterized;
+import org.openrdf.query.BooleanQuery;
+import org.openrdf.query.QueryLanguage;
+import org.openrdf.repository.Repository;
+import org.openrdf.repository.RepositoryConnection;
+import org.openrdf.repository.sail.SailRepository;
+import org.openrdf.rio.RDFFormat;
+import org.openrdf.sail.memory.MemoryStore;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.InputStream;
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.Collection;
+
+import static java.util.Arrays.asList;
+import static org.hamcrest.CoreMatchers.everyItem;
+import static org.hamcrest.CoreMatchers.notNullValue;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+import static org.junit.Assume.assumeThat;
+
+/**
+ * Add file description here!
+ * <p/>
+ * Author: Sebastian Schaffert
+ */
+@RunWith(Parameterized.class)
+public class TestJSONLdParser {
+
+ private static Logger log = LoggerFactory.getLogger(TestJSONLdParser.class);
+
+ private String fileName;
+
+ public TestJSONLdParser(String fileName) {
+ this.fileName = fileName;
+ }
+
+ // return the list of rdf-NNNN.jsonld files
+ @Parameterized.Parameters(name = "{0}")
+ public static Collection<Object[]> data() {
+ int[] skip = new int[] {1,2,8,9,10,11,12,14,15,16,17,18,21,22,25};
+ ArrayList<Object[]> list = new ArrayList<Object[]>();
+ for(int i=1; i<=26; i++) {
+ if(Arrays.binarySearch(skip,i) == -1) {
+ list.add(new Object[] {"rdf-"+String.format("%04d",i)});
+ }
+ }
+ return list;
+ }
+
+
+ @Test
+ public void runTest() throws Exception {
+ log.info("running test {} ...", fileName);
+
+ InputStream jsonLD = this.getClass().getResourceAsStream(fileName+".jsonld");
+ InputStream sparql = this.getClass().getResourceAsStream(fileName+".sparql");
+ assumeThat("Could not load testfiles", asList(jsonLD, sparql), everyItem(notNullValue(InputStream.class)));
+
+ Repository repository = new SailRepository(new MemoryStore());
+ repository.initialize();
+
+ RepositoryConnection connection = repository.getConnection();
+ try {
+ connection.add(jsonLD,"http://localhost/jsonld/", RDFFormat.JSONLD);
+ connection.commit();
+ } catch(Exception ex) {
+ fail("parsing "+fileName+" failed!");
+ }
+ assertTrue(connection.size() > 0);
+
+ int count = connection.getStatements(null, null, null, false).asList().size();
+ assertTrue(count > 0);
+
+ BooleanQuery sparqlQuery = (BooleanQuery)connection.prepareQuery(QueryLanguage.SPARQL, IOUtils.toString(sparql));
+ assertTrue("SPARQL query evaluation for "+fileName+" failed",sparqlQuery.evaluate());
+
+ connection.close();
+ repository.shutDown();
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/21a28cf8/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0001-context.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0001-context.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0001-context.jsonld
new file mode 100644
index 0000000..8eddd02
--- /dev/null
+++ b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0001-context.jsonld
@@ -0,0 +1,13 @@
+{
+ "@context": {
+ "dc": "http://purl.org/dc/elements/1.1/",
+ "ex": "http://example.org/vocab#",
+ "ex:authored": {
+ "@type": "@id"
+ },
+ "ex:contains": {
+ "@type": "@id"
+ },
+ "foaf": "http://xmlns.com/foaf/0.1/"
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/21a28cf8/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0001-in.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0001-in.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0001-in.jsonld
new file mode 100644
index 0000000..bb26e1a
--- /dev/null
+++ b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0001-in.jsonld
@@ -0,0 +1,27 @@
+{
+ "@id": [
+ {
+ "@id": "http://example.org/test#chapter",
+ "http://purl.org/dc/elements/1.1/description": "Fun",
+ "http://purl.org/dc/elements/1.1/title": "Chapter One"
+ },
+ {
+ "@id": "http://example.org/test#jane",
+ "http://example.org/vocab#authored": "http://example.org/test#chapter",
+ "http://xmlns.com/foaf/0.1/name": "Jane"
+ },
+ {
+ "@id": "http://example.org/test#john",
+ "http://xmlns.com/foaf/0.1/name": "John"
+ },
+ {
+ "@id": "http://example.org/test#library",
+ "http://example.org/vocab#contains": {
+ "@id": "http://example.org/test#book",
+ "http://example.org/vocab#contains": "http://example.org/test#chapter",
+ "http://purl.org/dc/elements/1.1/contributor": "Writer",
+ "http://purl.org/dc/elements/1.1/title": "My Book"
+ }
+ }
+ ]
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/21a28cf8/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0001-out.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0001-out.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0001-out.jsonld
new file mode 100644
index 0000000..678a298
--- /dev/null
+++ b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0001-out.jsonld
@@ -0,0 +1,38 @@
+{
+ "@context": {
+ "dc": "http://purl.org/dc/elements/1.1/",
+ "ex": "http://example.org/vocab#",
+ "ex:authored": {
+ "@type": "@id"
+ },
+ "ex:contains": {
+ "@type": "@id"
+ },
+ "foaf": "http://xmlns.com/foaf/0.1/"
+ },
+ "@id": [
+ {
+ "@id": "http://example.org/test#chapter",
+ "dc:description": "Fun",
+ "dc:title": "Chapter One"
+ },
+ {
+ "@id": "http://example.org/test#jane",
+ "ex:authored": "http://example.org/test#chapter",
+ "foaf:name": "Jane"
+ },
+ {
+ "@id": "http://example.org/test#john",
+ "foaf:name": "John"
+ },
+ {
+ "@id": "http://example.org/test#library",
+ "ex:contains": {
+ "@id": "http://example.org/test#book",
+ "dc:contributor": "Writer",
+ "dc:title": "My Book",
+ "ex:contains": "http://example.org/test#chapter"
+ }
+ }
+ ]
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/21a28cf8/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0002-context.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0002-context.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0002-context.jsonld
new file mode 100644
index 0000000..4ad288e
--- /dev/null
+++ b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0002-context.jsonld
@@ -0,0 +1,6 @@
+{
+ "@context": {
+ "dc": "http://purl.org/dc/terms/",
+ "ex": "http://example.org/test#"
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/21a28cf8/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0002-in.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0002-in.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0002-in.jsonld
new file mode 100644
index 0000000..580e172
--- /dev/null
+++ b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0002-in.jsonld
@@ -0,0 +1,4 @@
+{
+ "@id": "http://example.org/test#thing",
+ "http://purl.org/dc/terms/title": "Title"
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/21a28cf8/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0002-out.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0002-out.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0002-out.jsonld
new file mode 100644
index 0000000..79117e9
--- /dev/null
+++ b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0002-out.jsonld
@@ -0,0 +1,8 @@
+{
+ "@context": {
+ "dc": "http://purl.org/dc/terms/",
+ "ex": "http://example.org/test#"
+ },
+ "@id": "ex:thing",
+ "dc:title": "Title"
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/21a28cf8/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0003-context.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0003-context.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0003-context.jsonld
new file mode 100644
index 0000000..58040b8
--- /dev/null
+++ b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0003-context.jsonld
@@ -0,0 +1,9 @@
+{
+ "@context": {
+ "dc": "http://purl.org/dc/elements/1.1/",
+ "ex": "http://example.org/vocab#",
+ "ex:contains": {
+ "@type": "@id"
+ }
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/21a28cf8/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0003-in.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0003-in.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0003-in.jsonld
new file mode 100644
index 0000000..9b70fba
--- /dev/null
+++ b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0003-in.jsonld
@@ -0,0 +1,7 @@
+{
+ "@id": "http://example.org/test#book",
+ "http://example.org/vocab#contains": {
+ "@id": "http://example.org/test#chapter"
+ },
+ "http://purl.org/dc/elements/1.1/title": "Title"
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/21a28cf8/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0003-out.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0003-out.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0003-out.jsonld
new file mode 100644
index 0000000..d0c0e7e
--- /dev/null
+++ b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0003-out.jsonld
@@ -0,0 +1,12 @@
+{
+ "@context": {
+ "dc": "http://purl.org/dc/elements/1.1/",
+ "ex": "http://example.org/vocab#",
+ "ex:contains": {
+ "@type": "@id"
+ }
+ },
+ "@id": "http://example.org/test#book",
+ "dc:title": "Title",
+ "ex:contains": "http://example.org/test#chapter"
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/21a28cf8/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0004-context.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0004-context.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0004-context.jsonld
new file mode 100644
index 0000000..81b7978
--- /dev/null
+++ b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0004-context.jsonld
@@ -0,0 +1,9 @@
+{
+ "@context": {
+ "ex": "http://example.org/test#",
+ "ex:int": {
+ "@type": "xsd:integer"
+ },
+ "xsd": "http://www.w3.org/2001/XMLSchema#"
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/21a28cf8/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0004-in.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0004-in.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0004-in.jsonld
new file mode 100644
index 0000000..6c3f88a
--- /dev/null
+++ b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0004-in.jsonld
@@ -0,0 +1,7 @@
+{
+ "@id": "http://example.org/test",
+ "http://example.org/test#int": {
+ "@value": "123",
+ "@type": "http://www.w3.org/2001/XMLSchema#integer"
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/21a28cf8/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0004-out.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0004-out.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0004-out.jsonld
new file mode 100644
index 0000000..3b826ea
--- /dev/null
+++ b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0004-out.jsonld
@@ -0,0 +1,11 @@
+{
+ "@context": {
+ "ex": "http://example.org/test#",
+ "ex:int": {
+ "@type": "xsd:integer"
+ },
+ "xsd": "http://www.w3.org/2001/XMLSchema#"
+ },
+ "@id": "http://example.org/test",
+ "ex:int": 123
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/21a28cf8/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0005-context.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0005-context.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0005-context.jsonld
new file mode 100644
index 0000000..16469c8
--- /dev/null
+++ b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0005-context.jsonld
@@ -0,0 +1,12 @@
+{
+ "@context": {
+ "ex": "http://example.org/vocab#",
+ "ex:date": {
+ "@type": "xsd:dateTime"
+ },
+ "ex:parent": {
+ "@type": "@id"
+ },
+ "xsd": "http://www.w3.org/2001/XMLSchema#"
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/21a28cf8/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0005-in.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0005-in.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0005-in.jsonld
new file mode 100644
index 0000000..c67c753
--- /dev/null
+++ b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0005-in.jsonld
@@ -0,0 +1,13 @@
+{
+ "@id": "http://example.org/test#example1",
+ "http://example.org/vocab#date": {
+ "@value": "2011-01-25T00:00:00Z",
+ "@type": "http://www.w3.org/2001/XMLSchema#dateTime"
+ },
+ "http://example.org/vocab#embed": {
+ "@id": "http://example.org/test#example2",
+ "http://example.org/vocab#parent": {
+ "@id": "http://example.org/test#example1"
+ }
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/21a28cf8/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0005-out.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0005-out.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0005-out.jsonld
new file mode 100644
index 0000000..b49fac4
--- /dev/null
+++ b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0005-out.jsonld
@@ -0,0 +1,18 @@
+{
+ "@context": {
+ "ex": "http://example.org/vocab#",
+ "ex:date": {
+ "@type": "xsd:dateTime"
+ },
+ "ex:parent": {
+ "@type": "@id"
+ },
+ "xsd": "http://www.w3.org/2001/XMLSchema#"
+ },
+ "@id": "http://example.org/test#example1",
+ "ex:date": "2011-01-25T00:00:00Z",
+ "ex:embed": {
+ "@id": "http://example.org/test#example2",
+ "ex:parent": "http://example.org/test#example1"
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/21a28cf8/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0006-context.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0006-context.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0006-context.jsonld
new file mode 100644
index 0000000..3f53478
--- /dev/null
+++ b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0006-context.jsonld
@@ -0,0 +1,5 @@
+{
+ "@context": {
+ "ex": "http://example.org/vocab#"
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/21a28cf8/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0006-in.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0006-in.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0006-in.jsonld
new file mode 100644
index 0000000..558acbf
--- /dev/null
+++ b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0006-in.jsonld
@@ -0,0 +1,19 @@
+{
+ "@id": "http://example.org/test",
+ "http://example.org/vocab#bool": {
+ "@value": "true",
+ "@type": "http://www.w3.org/2001/XMLSchema#boolean"
+ },
+ "http://example.org/vocab#double": {
+ "@value": "1.230000e+00",
+ "@type": "http://www.w3.org/2001/XMLSchema#double"
+ },
+ "http://example.org/vocab#double-zero": {
+ "@value": "0.000000e+00",
+ "@type": "http://www.w3.org/2001/XMLSchema#double"
+ },
+ "http://example.org/vocab#int": {
+ "@value": "123",
+ "@type": "http://www.w3.org/2001/XMLSchema#integer"
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/21a28cf8/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0006-out.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0006-out.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0006-out.jsonld
new file mode 100644
index 0000000..8ded5f5
--- /dev/null
+++ b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0006-out.jsonld
@@ -0,0 +1,10 @@
+{
+ "@context": {
+ "ex": "http://example.org/vocab#"
+ },
+ "@id": "http://example.org/test",
+ "ex:bool": true,
+ "ex:double": 1.23,
+ "ex:double-zero": 0,
+ "ex:int": 123
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/21a28cf8/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0007-context.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0007-context.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0007-context.jsonld
new file mode 100644
index 0000000..45b8c52
--- /dev/null
+++ b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0007-context.jsonld
@@ -0,0 +1,15 @@
+{
+ "@context": {
+ "ex": "http://example.org/vocab#",
+ "ex:bool": {
+ "@type": "xsd:boolean"
+ },
+ "ex:double": {
+ "@type": "xsd:double"
+ },
+ "ex:int": {
+ "@type": "xsd:integer"
+ },
+ "xsd": "http://www.w3.org/2001/XMLSchema#"
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/21a28cf8/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0007-in.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0007-in.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0007-in.jsonld
new file mode 100644
index 0000000..558acbf
--- /dev/null
+++ b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0007-in.jsonld
@@ -0,0 +1,19 @@
+{
+ "@id": "http://example.org/test",
+ "http://example.org/vocab#bool": {
+ "@value": "true",
+ "@type": "http://www.w3.org/2001/XMLSchema#boolean"
+ },
+ "http://example.org/vocab#double": {
+ "@value": "1.230000e+00",
+ "@type": "http://www.w3.org/2001/XMLSchema#double"
+ },
+ "http://example.org/vocab#double-zero": {
+ "@value": "0.000000e+00",
+ "@type": "http://www.w3.org/2001/XMLSchema#double"
+ },
+ "http://example.org/vocab#int": {
+ "@value": "123",
+ "@type": "http://www.w3.org/2001/XMLSchema#integer"
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/21a28cf8/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0007-out.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0007-out.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0007-out.jsonld
new file mode 100644
index 0000000..f18bdcd
--- /dev/null
+++ b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0007-out.jsonld
@@ -0,0 +1,20 @@
+{
+ "@context": {
+ "ex": "http://example.org/vocab#",
+ "ex:bool": {
+ "@type": "xsd:boolean"
+ },
+ "ex:double": {
+ "@type": "xsd:double"
+ },
+ "ex:int": {
+ "@type": "xsd:integer"
+ },
+ "xsd": "http://www.w3.org/2001/XMLSchema#"
+ },
+ "@id": "http://example.org/test",
+ "ex:bool": true,
+ "ex:double": 1.23,
+ "ex:double-zero": 0,
+ "ex:int": 123
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/21a28cf8/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0008-context.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0008-context.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0008-context.jsonld
new file mode 100644
index 0000000..3f53478
--- /dev/null
+++ b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0008-context.jsonld
@@ -0,0 +1,5 @@
+{
+ "@context": {
+ "ex": "http://example.org/vocab#"
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/21a28cf8/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0008-in.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0008-in.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0008-in.jsonld
new file mode 100644
index 0000000..44a5b78
--- /dev/null
+++ b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0008-in.jsonld
@@ -0,0 +1,7 @@
+{
+ "@id": "http://example.org/test",
+ "http://example.org/vocab#test": {
+ "@language": "en",
+ "@value": "test"
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/21a28cf8/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0008-out.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0008-out.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0008-out.jsonld
new file mode 100644
index 0000000..5ab536c
--- /dev/null
+++ b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0008-out.jsonld
@@ -0,0 +1,10 @@
+{
+ "@context": {
+ "ex": "http://example.org/vocab#"
+ },
+ "@id": "http://example.org/test",
+ "ex:test": {
+ "@language": "en",
+ "@value": "test"
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/21a28cf8/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0009-context.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0009-context.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0009-context.jsonld
new file mode 100644
index 0000000..8848f73
--- /dev/null
+++ b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0009-context.jsonld
@@ -0,0 +1,9 @@
+{
+ "@context": {
+ "homepage": {
+ "@id": "http://xmlns.com/foaf/0.1/homepage",
+ "@type": "@id"
+ },
+ "name": "http://xmlns.com/foaf/0.1/name"
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/21a28cf8/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0009-in.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0009-in.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0009-in.jsonld
new file mode 100644
index 0000000..057da6f
--- /dev/null
+++ b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0009-in.jsonld
@@ -0,0 +1,9 @@
+[
+ {
+ "http://xmlns.com/foaf/0.1/homepage": {
+ "@id": "http://john.doe.org/"
+ },
+ "http://xmlns.com/foaf/0.1/name": "John Doe"
+ },
+ {}
+]
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/21a28cf8/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0009-out.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0009-out.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0009-out.jsonld
new file mode 100644
index 0000000..09d3937
--- /dev/null
+++ b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0009-out.jsonld
@@ -0,0 +1,17 @@
+{
+ "@context": {
+ "homepage": {
+ "@id": "http://xmlns.com/foaf/0.1/homepage",
+ "@type": "@id"
+ },
+ "name": "http://xmlns.com/foaf/0.1/name"
+ },
+ "@id": [
+ {
+ "homepage": "http://john.doe.org/",
+ "name": "John Doe"
+ },
+ {
+ }
+ ]
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/21a28cf8/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0010-context.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0010-context.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0010-context.jsonld
new file mode 100644
index 0000000..5b73639
--- /dev/null
+++ b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0010-context.jsonld
@@ -0,0 +1,14 @@
+{
+ "@context": {
+ "http://example.org/test#property1": {
+ "@type": "uri"
+ },
+ "http://example.org/test#property2": {
+ "@type": "uri"
+ },
+ "http://example.org/test#property3": {
+ "@type": "uri"
+ },
+ "uri": "@id"
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/21a28cf8/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0010-in.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0010-in.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0010-in.jsonld
new file mode 100644
index 0000000..a941054
--- /dev/null
+++ b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0010-in.jsonld
@@ -0,0 +1,13 @@
+{
+ "@id": "http://example.org/test#example1",
+ "http://example.org/test#property1": {
+ "@id": "http://example.org/test#example2",
+ "http://example.org/test#property4": "foo"
+ },
+ "http://example.org/test#property2": {
+ "@id": "http://example.org/test#example3"
+ },
+ "http://example.org/test#property3": {
+ "@id": "http://example.org/test#example4"
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/21a28cf8/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0010-out.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0010-out.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0010-out.jsonld
new file mode 100644
index 0000000..5829d34
--- /dev/null
+++ b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-0010-out.jsonld
@@ -0,0 +1,18 @@
+{
+ "@context": {
+ "http://example.org/test#property2": {
+ "@type": "uri"
+ },
+ "http://example.org/test#property3": {
+ "@type": "uri"
+ },
+ "uri": "@id"
+ },
+ "http://example.org/test#property1": {
+ "http://example.org/test#property4": "foo",
+ "uri": "http://example.org/test#example2"
+ },
+ "http://example.org/test#property2": "http://example.org/test#example3",
+ "http://example.org/test#property3": "http://example.org/test#example4",
+ "uri": "http://example.org/test#example1"
+}
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/21a28cf8/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-manifest.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-manifest.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-manifest.jsonld
new file mode 100644
index 0000000..319ffb4
--- /dev/null
+++ b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/compact-manifest.jsonld
@@ -0,0 +1,68 @@
+{
+ "@context": "http://json-ld.org/test-suite/context.jsonld",
+ "@id": "",
+ "@type": "jld:Manifest",
+ "rdfs:comment": "JSON-LD to Compaction tests use object compare",
+ "name": "compact",
+ "sequence": [{
+ "@type": ["test:TestCase", "jld:CompactTest"],
+ "name": "add context",
+ "input": "compact-0001-in.jsonld",
+ "context": "compact-0001-context.jsonld",
+ "expect": "compact-0001-out.jsonld"
+ }, {
+ "@type": ["test:TestCase", "jld:CompactTest"],
+ "name": "reduced context",
+ "input": "compact-0002-in.jsonld",
+ "context": "compact-0002-context.jsonld",
+ "expect": "compact-0002-out.jsonld"
+ }, {
+ "@type": ["test:TestCase", "jld:CompactTest"],
+ "name": "coerced ex:contains",
+ "input": "compact-0003-in.jsonld",
+ "context": "compact-0003-context.jsonld",
+ "expect": "compact-0003-out.jsonld"
+ }, {
+ "@type": ["test:TestCase", "jld:CompactTest"],
+ "name": "with coerce",
+ "input": "compact-0004-in.jsonld",
+ "context": "compact-0004-context.jsonld",
+ "expect": "compact-0004-out.jsonld"
+ }, {
+ "@type": ["test:TestCase", "jld:CompactTest"],
+ "name": "with date coerce",
+ "input": "compact-0005-in.jsonld",
+ "context": "compact-0005-context.jsonld",
+ "expect": "compact-0005-out.jsonld"
+ }, {
+ "@type": ["test:TestCase", "jld:CompactTest"],
+ "name": "native types",
+ "input": "compact-0006-in.jsonld",
+ "context": "compact-0006-context.jsonld",
+ "expect": "compact-0006-out.jsonld"
+ }, {
+ "@type": ["test:TestCase", "jld:CompactTest"],
+ "name": "native types with coerce",
+ "input": "compact-0007-in.jsonld",
+ "context": "compact-0007-context.jsonld",
+ "expect": "compact-0007-out.jsonld"
+ }, {
+ "@type": ["test:TestCase", "jld:CompactTest"],
+ "name": "literal with language",
+ "input": "compact-0008-in.jsonld",
+ "context": "compact-0008-context.jsonld",
+ "expect": "compact-0008-out.jsonld"
+ }, {
+ "@type": ["test:TestCase", "jld:CompactTest"],
+ "name": "disjoint graph as array",
+ "input": "compact-0009-in.jsonld",
+ "context": "compact-0009-context.jsonld",
+ "expect": "compact-0009-out.jsonld"
+ }, {
+ "@type": ["test:TestCase", "jld:CompactTest"],
+ "name": "alias keywords",
+ "input": "compact-0010-in.jsonld",
+ "context": "compact-0010-context.jsonld",
+ "expect": "compact-0010-out.jsonld"
+ }]
+}
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/21a28cf8/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/expand-0001-in.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/expand-0001-in.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/expand-0001-in.jsonld
new file mode 100644
index 0000000..39c6605
--- /dev/null
+++ b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/expand-0001-in.jsonld
@@ -0,0 +1,3 @@
+{
+ "@id": "http://example.org/test#example"
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/21a28cf8/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/expand-0001-out.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/expand-0001-out.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/expand-0001-out.jsonld
new file mode 100644
index 0000000..39c6605
--- /dev/null
+++ b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/expand-0001-out.jsonld
@@ -0,0 +1,3 @@
+{
+ "@id": "http://example.org/test#example"
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/21a28cf8/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/expand-0002-in.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/expand-0002-in.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/expand-0002-in.jsonld
new file mode 100644
index 0000000..ac24485
--- /dev/null
+++ b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/expand-0002-in.jsonld
@@ -0,0 +1,39 @@
+{
+ "@context": {
+ "dc": "http://purl.org/dc/elements/1.1/",
+ "ex": "http://example.org/vocab#",
+ "ex:authored": {
+ "@type": "@id"
+ },
+ "ex:contains": {
+ "@type": "@id"
+ },
+ "foaf": "http://xmlns.com/foaf/0.1/",
+ "xsd": "http://www.w3.org/2001/XMLSchema#"
+ },
+ "@id": [
+ {
+ "@id": "http://example.org/test#chapter",
+ "dc:description": "Fun",
+ "dc:title": "Chapter One"
+ },
+ {
+ "@id": "http://example.org/test#jane",
+ "ex:authored": "http://example.org/test#chapter",
+ "foaf:name": "Jane"
+ },
+ {
+ "@id": "http://example.org/test#john",
+ "foaf:name": "John"
+ },
+ {
+ "@id": "http://example.org/test#library",
+ "ex:contains": {
+ "@id": "http://example.org/test#book",
+ "dc:contributor": "Writer",
+ "dc:title": "My Book",
+ "ex:contains": "http://example.org/test#chapter"
+ }
+ }
+ ]
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/21a28cf8/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/expand-0002-out.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/expand-0002-out.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/expand-0002-out.jsonld
new file mode 100644
index 0000000..47eda67
--- /dev/null
+++ b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/expand-0002-out.jsonld
@@ -0,0 +1,31 @@
+{
+ "@id": [
+ {
+ "@id": "http://example.org/test#chapter",
+ "http://purl.org/dc/elements/1.1/description": "Fun",
+ "http://purl.org/dc/elements/1.1/title": "Chapter One"
+ },
+ {
+ "@id": "http://example.org/test#jane",
+ "http://example.org/vocab#authored": {
+ "@id": "http://example.org/test#chapter"
+ },
+ "http://xmlns.com/foaf/0.1/name": "Jane"
+ },
+ {
+ "@id": "http://example.org/test#john",
+ "http://xmlns.com/foaf/0.1/name": "John"
+ },
+ {
+ "@id": "http://example.org/test#library",
+ "http://example.org/vocab#contains": {
+ "@id": "http://example.org/test#book",
+ "http://example.org/vocab#contains": {
+ "@id": "http://example.org/test#chapter"
+ },
+ "http://purl.org/dc/elements/1.1/contributor": "Writer",
+ "http://purl.org/dc/elements/1.1/title": "My Book"
+ }
+ }
+ ]
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/21a28cf8/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/expand-0003-in.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/expand-0003-in.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/expand-0003-in.jsonld
new file mode 100644
index 0000000..1581559
--- /dev/null
+++ b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/expand-0003-in.jsonld
@@ -0,0 +1,13 @@
+{
+ "@context": {
+ "dc": "http://purl.org/dc/elements/1.1/",
+ "ex": "http://example.org/vocab#",
+ "ex:contains": {
+ "@type": "@id"
+ },
+ "xsd": "http://www.w3.org/2001/XMLSchema#"
+ },
+ "@id": "http://example.org/test#book",
+ "dc:title": "Title",
+ "ex:contains": "http://example.org/test#chapter"
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/21a28cf8/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/expand-0003-out.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/expand-0003-out.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/expand-0003-out.jsonld
new file mode 100644
index 0000000..9b70fba
--- /dev/null
+++ b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/expand-0003-out.jsonld
@@ -0,0 +1,7 @@
+{
+ "@id": "http://example.org/test#book",
+ "http://example.org/vocab#contains": {
+ "@id": "http://example.org/test#chapter"
+ },
+ "http://purl.org/dc/elements/1.1/title": "Title"
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/21a28cf8/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/expand-0004-in.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/expand-0004-in.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/expand-0004-in.jsonld
new file mode 100644
index 0000000..b49fac4
--- /dev/null
+++ b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/expand-0004-in.jsonld
@@ -0,0 +1,18 @@
+{
+ "@context": {
+ "ex": "http://example.org/vocab#",
+ "ex:date": {
+ "@type": "xsd:dateTime"
+ },
+ "ex:parent": {
+ "@type": "@id"
+ },
+ "xsd": "http://www.w3.org/2001/XMLSchema#"
+ },
+ "@id": "http://example.org/test#example1",
+ "ex:date": "2011-01-25T00:00:00Z",
+ "ex:embed": {
+ "@id": "http://example.org/test#example2",
+ "ex:parent": "http://example.org/test#example1"
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/21a28cf8/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/expand-0004-out.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/expand-0004-out.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/expand-0004-out.jsonld
new file mode 100644
index 0000000..c67c753
--- /dev/null
+++ b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/expand-0004-out.jsonld
@@ -0,0 +1,13 @@
+{
+ "@id": "http://example.org/test#example1",
+ "http://example.org/vocab#date": {
+ "@value": "2011-01-25T00:00:00Z",
+ "@type": "http://www.w3.org/2001/XMLSchema#dateTime"
+ },
+ "http://example.org/vocab#embed": {
+ "@id": "http://example.org/test#example2",
+ "http://example.org/vocab#parent": {
+ "@id": "http://example.org/test#example1"
+ }
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/21a28cf8/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/expand-0005-in.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/expand-0005-in.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/expand-0005-in.jsonld
new file mode 100644
index 0000000..e723b25
--- /dev/null
+++ b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/expand-0005-in.jsonld
@@ -0,0 +1,16 @@
+{
+ "@context": {
+ "d": "http://purl.org/dc/elements/1.1/",
+ "e": "http://example.org/vocab#",
+ "e:double-zero": {
+ "@type": "xsd:double"
+ },
+ "f": "http://xmlns.com/foaf/0.1/",
+ "xsd": "http://www.w3.org/2001/XMLSchema#"
+ },
+ "@id": "http://example.org/test",
+ "e:bool": true,
+ "e:double": 1.23,
+ "e:double-zero": 0.0e0,
+ "e:int": 123
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/21a28cf8/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/expand-0005-out.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/expand-0005-out.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/expand-0005-out.jsonld
new file mode 100644
index 0000000..e2a6b7d
--- /dev/null
+++ b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/expand-0005-out.jsonld
@@ -0,0 +1,19 @@
+{
+ "@id": "http://example.org/test",
+ "http://example.org/vocab#bool": {
+ "@value": "true",
+ "@type": "http://www.w3.org/2001/XMLSchema#boolean"
+ },
+ "http://example.org/vocab#double": {
+ "@value": "1.230000e+00",
+ "@type": "http://www.w3.org/2001/XMLSchema#double"
+ },
+ "http://example.org/vocab#double-zero": {
+ "@value": "0.000000e+00",
+ "@type": "http://www.w3.org/2001/XMLSchema#double"
+ },
+ "http://example.org/vocab#int": {
+ "@value": "123",
+ "@type": "http://www.w3.org/2001/XMLSchema#integer"
+ }
+}
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/21a28cf8/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/expand-0006-in.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/expand-0006-in.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/expand-0006-in.jsonld
new file mode 100644
index 0000000..6c3f88a
--- /dev/null
+++ b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/expand-0006-in.jsonld
@@ -0,0 +1,7 @@
+{
+ "@id": "http://example.org/test",
+ "http://example.org/test#int": {
+ "@value": "123",
+ "@type": "http://www.w3.org/2001/XMLSchema#integer"
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/21a28cf8/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/expand-0006-out.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/expand-0006-out.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/expand-0006-out.jsonld
new file mode 100644
index 0000000..6c3f88a
--- /dev/null
+++ b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/expand-0006-out.jsonld
@@ -0,0 +1,7 @@
+{
+ "@id": "http://example.org/test",
+ "http://example.org/test#int": {
+ "@value": "123",
+ "@type": "http://www.w3.org/2001/XMLSchema#integer"
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/21a28cf8/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/expand-0007-in.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/expand-0007-in.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/expand-0007-in.jsonld
new file mode 100644
index 0000000..5ab536c
--- /dev/null
+++ b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/expand-0007-in.jsonld
@@ -0,0 +1,10 @@
+{
+ "@context": {
+ "ex": "http://example.org/vocab#"
+ },
+ "@id": "http://example.org/test",
+ "ex:test": {
+ "@language": "en",
+ "@value": "test"
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/21a28cf8/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/expand-0007-out.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/expand-0007-out.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/expand-0007-out.jsonld
new file mode 100644
index 0000000..44a5b78
--- /dev/null
+++ b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/expand-0007-out.jsonld
@@ -0,0 +1,7 @@
+{
+ "@id": "http://example.org/test",
+ "http://example.org/vocab#test": {
+ "@language": "en",
+ "@value": "test"
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/21a28cf8/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/expand-0008-in.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/expand-0008-in.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/expand-0008-in.jsonld
new file mode 100644
index 0000000..37f9ecb
--- /dev/null
+++ b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/expand-0008-in.jsonld
@@ -0,0 +1,20 @@
+{
+ "@context": {
+ "http://example.org/test#property1": {
+ "@type": "uri"
+ },
+ "http://example.org/test#property2": {
+ "@type": "uri"
+ },
+ "uri": "@id"
+ },
+ "http://example.org/test#property1": {
+ "http://example.org/test#property4": "foo",
+ "uri": "http://example.org/test#example2"
+ },
+ "http://example.org/test#property2": "http://example.org/test#example3",
+ "http://example.org/test#property3": {
+ "uri": "http://example.org/test#example4"
+ },
+ "uri": "http://example.org/test#example1"
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/21a28cf8/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/expand-0008-out.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/expand-0008-out.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/expand-0008-out.jsonld
new file mode 100644
index 0000000..a941054
--- /dev/null
+++ b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/expand-0008-out.jsonld
@@ -0,0 +1,13 @@
+{
+ "@id": "http://example.org/test#example1",
+ "http://example.org/test#property1": {
+ "@id": "http://example.org/test#example2",
+ "http://example.org/test#property4": "foo"
+ },
+ "http://example.org/test#property2": {
+ "@id": "http://example.org/test#example3"
+ },
+ "http://example.org/test#property3": {
+ "@id": "http://example.org/test#example4"
+ }
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/21a28cf8/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/expand-0009-in.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/expand-0009-in.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/expand-0009-in.jsonld
new file mode 100644
index 0000000..eca3461
--- /dev/null
+++ b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/expand-0009-in.jsonld
@@ -0,0 +1,43 @@
+{
+ "@context": {
+ "authored": {
+ "@id": "http://example.org/vocab#authored",
+ "@type": "@id"
+ },
+ "contains": {
+ "@id": "http://example.org/vocab#contains",
+ "@type": "@id"
+ },
+ "contributor": "http://purl.org/dc/elements/1.1/contributor",
+ "description": "http://purl.org/dc/elements/1.1/description",
+ "name": "http://xmlns.com/foaf/0.1/name",
+ "title": {
+ "@id": "http://purl.org/dc/elements/1.1/title"
+ }
+ },
+ "@id": [
+ {
+ "@id": "http://example.org/test#chapter",
+ "description": "Fun",
+ "title": "Chapter One"
+ },
+ {
+ "@id": "http://example.org/test#jane",
+ "authored": "http://example.org/test#chapter",
+ "name": "Jane"
+ },
+ {
+ "@id": "http://example.org/test#john",
+ "name": "John"
+ },
+ {
+ "@id": "http://example.org/test#library",
+ "contains": {
+ "@id": "http://example.org/test#book",
+ "contains": "http://example.org/test#chapter",
+ "contributor": "Writer",
+ "title": "My Book"
+ }
+ }
+ ]
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/21a28cf8/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/expand-0009-out.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/expand-0009-out.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/expand-0009-out.jsonld
new file mode 100644
index 0000000..47eda67
--- /dev/null
+++ b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/expand-0009-out.jsonld
@@ -0,0 +1,31 @@
+{
+ "@id": [
+ {
+ "@id": "http://example.org/test#chapter",
+ "http://purl.org/dc/elements/1.1/description": "Fun",
+ "http://purl.org/dc/elements/1.1/title": "Chapter One"
+ },
+ {
+ "@id": "http://example.org/test#jane",
+ "http://example.org/vocab#authored": {
+ "@id": "http://example.org/test#chapter"
+ },
+ "http://xmlns.com/foaf/0.1/name": "Jane"
+ },
+ {
+ "@id": "http://example.org/test#john",
+ "http://xmlns.com/foaf/0.1/name": "John"
+ },
+ {
+ "@id": "http://example.org/test#library",
+ "http://example.org/vocab#contains": {
+ "@id": "http://example.org/test#book",
+ "http://example.org/vocab#contains": {
+ "@id": "http://example.org/test#chapter"
+ },
+ "http://purl.org/dc/elements/1.1/contributor": "Writer",
+ "http://purl.org/dc/elements/1.1/title": "My Book"
+ }
+ }
+ ]
+}
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/21a28cf8/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/expand-0010-in.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/expand-0010-in.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/expand-0010-in.jsonld
new file mode 100644
index 0000000..16e6232
--- /dev/null
+++ b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/expand-0010-in.jsonld
@@ -0,0 +1,23 @@
+{
+ "@context": {
+ "name": "http://xmlns.com/foaf/0.1/name",
+ "homepage": {
+ "@id": "http://xmlns.com/foaf/0.1/homepage",
+ "@type": "@id"
+ },
+ "know": "http://xmlns.com/foaf/0.1/knows",
+ "@iri": "@id"
+ },
+ "@id": "#me",
+ "know": [
+ {
+ "@id": "http://example.com/bob#me",
+ "name": "Bob",
+ "homepage": "http://example.com/bob"
+ }, {
+ "@id": "http://example.com/alice#me",
+ "name": "Alice",
+ "homepage": "http://example.com/alice"
+ }
+ ]
+}
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/21a28cf8/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/expand-0010-out.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/expand-0010-out.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/expand-0010-out.jsonld
new file mode 100644
index 0000000..09966fd
--- /dev/null
+++ b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/expand-0010-out.jsonld
@@ -0,0 +1,18 @@
+{
+ "@id": "#me",
+ "http://xmlns.com/foaf/0.1/knows": [
+ {
+ "@id": "http://example.com/bob#me",
+ "http://xmlns.com/foaf/0.1/name": "Bob",
+ "http://xmlns.com/foaf/0.1/homepage": {
+ "@id": "http://example.com/bob"
+ }
+ }, {
+ "@id": "http://example.com/alice#me",
+ "http://xmlns.com/foaf/0.1/name": "Alice",
+ "http://xmlns.com/foaf/0.1/homepage": {
+ "@id": "http://example.com/alice"
+ }
+ }
+ ]
+}
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/21a28cf8/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/expand-manifest.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/expand-manifest.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/expand-manifest.jsonld
new file mode 100644
index 0000000..0e044a4
--- /dev/null
+++ b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/expand-manifest.jsonld
@@ -0,0 +1,58 @@
+{
+ "@context": "http://json-ld.org/test-suite/context.jsonld",
+ "@id": "",
+ "@type": "jld:Manifest",
+ "rdfs:comment": "JSON-LD to Expansion tests use object compare",
+ "name": "expand",
+ "sequence": [{
+ "@type": ["test:TestCase", "jld:ExpandTest"],
+ "name": "id",
+ "input": "expand-0001-in.jsonld",
+ "expect": "expand-0001-out.jsonld"
+ }, {
+ "@type": ["test:TestCase", "jld:ExpandTest"],
+ "name": "complex",
+ "input": "expand-0002-in.jsonld",
+ "expect": "expand-0002-out.jsonld"
+ }, {
+ "@type": ["test:TestCase", "jld:ExpandTest"],
+ "name": "coerced ex:contains",
+ "input": "expand-0003-in.jsonld",
+ "expect": "expand-0003-out.jsonld"
+ }, {
+ "@type": ["test:TestCase", "jld:ExpandTest"],
+ "name": "remove type-coercion context",
+ "input": "expand-0004-in.jsonld",
+ "expect": "expand-0004-out.jsonld"
+ }, {
+ "@type": ["test:TestCase", "jld:ExpandTest"],
+ "name": "native types",
+ "input": "expand-0005-in.jsonld",
+ "expect": "expand-0005-out.jsonld"
+ }, {
+ "@type": ["test:TestCase", "jld:ExpandTest"],
+ "name": "native expanded type",
+ "input": "expand-0006-in.jsonld",
+ "expect": "expand-0006-out.jsonld"
+ }, {
+ "@type": ["test:TestCase", "jld:ExpandTest"],
+ "name": "literal with language",
+ "input": "expand-0007-in.jsonld",
+ "expect": "expand-0007-out.jsonld"
+ }, {
+ "@type": ["test:TestCase", "jld:ExpandTest"],
+ "name": "alias keywords",
+ "input": "expand-0008-in.jsonld",
+ "expect": "expand-0008-out.jsonld"
+ }, {
+ "@type": ["test:TestCase", "jld:ExpandTest"],
+ "name": "terms",
+ "input": "expand-0009-in.jsonld",
+ "expect": "expand-0009-out.jsonld"
+ }, {
+ "@type": ["test:TestCase", "jld:ExpandTest"],
+ "name": "do not expand aliased @id/@type",
+ "input": "expand-0010-in.jsonld",
+ "expect": "expand-0010-out.jsonld"
+ }]
+}
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/21a28cf8/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0001-frame.jsonld
----------------------------------------------------------------------
diff --git a/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0001-frame.jsonld b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0001-frame.jsonld
new file mode 100644
index 0000000..16faf5b
--- /dev/null
+++ b/commons/sesame-tools-rio-jsonld/src/test/resources/org/apache/marmotta/commons/sesame/rio/jsonld/frame-0001-frame.jsonld
@@ -0,0 +1,13 @@
+{
+ "@context": {
+ "dc": "http://purl.org/dc/elements/1.1/",
+ "ex": "http://example.org/vocab#"
+ },
+ "@type": "ex:Library",
+ "ex:contains": {
+ "@type": "ex:Book",
+ "ex:contains": {
+ "@type": "ex:Chapter"
+ }
+ }
+}
\ No newline at end of file