You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@marmotta.apache.org by wi...@apache.org on 2013/03/11 08:04:55 UTC
[2/3] git commit: added another test to test raw file directly served
without content negotiation
added another test to test raw file directly served without content negotiation
Project: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/commit/63bab30c
Tree: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/tree/63bab30c
Diff: http://git-wip-us.apache.org/repos/asf/incubator-marmotta/diff/63bab30c
Branch: refs/heads/master
Commit: 63bab30ce07c03321dd8ce952eab6c28bc509135
Parents: e56f5ab
Author: Sergio Fernández <wi...@apache.org>
Authored: Sun Mar 10 11:39:41 2013 +0100
Committer: Sergio Fernández <wi...@apache.org>
Committed: Sun Mar 10 11:39:41 2013 +0100
----------------------------------------------------------------------
.../ldclient/test/rdf/TestLinkedDataProvider.java | 25 +++++++++++++++
.../marmotta/ldclient/test/rdf/foaf-wikier.sparql | 8 +++++
2 files changed, 33 insertions(+), 0 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/63bab30c/libraries/ldclient/ldclient-provider-rdf/src/test/java/org/apache/marmotta/ldclient/test/rdf/TestLinkedDataProvider.java
----------------------------------------------------------------------
diff --git a/libraries/ldclient/ldclient-provider-rdf/src/test/java/org/apache/marmotta/ldclient/test/rdf/TestLinkedDataProvider.java b/libraries/ldclient/ldclient-provider-rdf/src/test/java/org/apache/marmotta/ldclient/test/rdf/TestLinkedDataProvider.java
index 1dc3f05..44dc9f0 100644
--- a/libraries/ldclient/ldclient-provider-rdf/src/test/java/org/apache/marmotta/ldclient/test/rdf/TestLinkedDataProvider.java
+++ b/libraries/ldclient/ldclient-provider-rdf/src/test/java/org/apache/marmotta/ldclient/test/rdf/TestLinkedDataProvider.java
@@ -44,6 +44,7 @@ public class TestLinkedDataProvider {
private static final String DBPEDIA = "http://dbpedia.org/resource/Berlin";
private static final String GEONAMES = "http://sws.geonames.org/3020251/";
private static final String MARMOTTA = "http://rdfohloh.wikier.org/project/marmotta";
+ private static final String WIKIER = "http://www.wikier.org/foaf#wikier";
private LDClientService ldclient;
@@ -132,5 +133,29 @@ public class TestLinkedDataProvider {
conn.commit();
conn.close();
}
+
+ /**
+ * This method tests accessing Sergio's FOAF profile, which is
+ * directly server by Apache HTTPd without content negotiation
+ *
+ * @throws Exception
+ *
+ */
+ @Test
+ public void testFoafWikier() throws Exception {
+ ClientResponse response = ldclient.retrieveResource(WIKIER);
+
+ RepositoryConnection conn = response.getTriples().getConnection();
+ conn.begin();
+ Assert.assertTrue(conn.size() > 0);
+
+ // run a SPARQL test to see if the returned data is correct
+ InputStream sparql = this.getClass().getResourceAsStream("foaf-wikier.sparql");
+ BooleanQuery testLabel = conn.prepareBooleanQuery(QueryLanguage.SPARQL, IOUtils.toString(sparql));
+ Assert.assertTrue("SPARQL test query failed", testLabel.evaluate());
+
+ conn.commit();
+ conn.close();
+ }
}
http://git-wip-us.apache.org/repos/asf/incubator-marmotta/blob/63bab30c/libraries/ldclient/ldclient-provider-rdf/src/test/resources/org/apache/marmotta/ldclient/test/rdf/foaf-wikier.sparql
----------------------------------------------------------------------
diff --git a/libraries/ldclient/ldclient-provider-rdf/src/test/resources/org/apache/marmotta/ldclient/test/rdf/foaf-wikier.sparql b/libraries/ldclient/ldclient-provider-rdf/src/test/resources/org/apache/marmotta/ldclient/test/rdf/foaf-wikier.sparql
new file mode 100644
index 0000000..0948548
--- /dev/null
+++ b/libraries/ldclient/ldclient-provider-rdf/src/test/resources/org/apache/marmotta/ldclient/test/rdf/foaf-wikier.sparql
@@ -0,0 +1,8 @@
+PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
+PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
+PREFIX foaf: <http://xmlns.com/foaf/0.1/>
+ASK {
+ <http://www.wikier.org/foaf#wikier> rdf:type foaf:Person ;
+ foaf:name "Sergio Fernández"@es ;
+ foaf:homepage <http://www.wikier.org> .
+}