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 2014/06/13 10:57:32 UTC
[012/100] [abbrv] [partial] Reverting the erroneous merge by
Sebastian according to the instructions in INFRA-6876
http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldclient/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldclient/pom.xml b/libraries/ldclient/pom.xml
index ad88ca4..084786b 100644
--- a/libraries/ldclient/pom.xml
+++ b/libraries/ldclient/pom.xml
@@ -21,7 +21,7 @@
<parent>
<groupId>org.apache.marmotta</groupId>
<artifactId>marmotta-parent</artifactId>
- <version>3.1.0-incubating-SNAPSHOT</version>
+ <version>3.1.0-incubating</version>
<relativePath>../../parent</relativePath>
</parent>
@@ -35,6 +35,27 @@
<!-- release management -->
<build>
+ <pluginManagement>
+ <plugins>
+ <plugin> <!-- generate JRebel Configuration -->
+ <groupId>org.zeroturnaround</groupId>
+ <artifactId>jrebel-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>generate-rebel-xml</id>
+ <phase>process-resources</phase>
+ <goals>
+ <goal>generate</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <relativePath>../../../</relativePath>
+ <rootPath>$${rebel.root}</rootPath>
+ </configuration>
+ </plugin>
+ </plugins>
+ </pluginManagement>
<plugins>
<!-- do not install / deploy reactor -->
<plugin>
http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldpath/ldpath-api/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-api/pom.xml b/libraries/ldpath/ldpath-api/pom.xml
index 174121e..d97b08f 100644
--- a/libraries/ldpath/ldpath-api/pom.xml
+++ b/libraries/ldpath/ldpath-api/pom.xml
@@ -21,7 +21,7 @@
<parent>
<groupId>org.apache.marmotta</groupId>
<artifactId>marmotta-parent</artifactId>
- <version>3.1.0-incubating-SNAPSHOT</version>
+ <version>3.1.0-incubating</version>
<relativePath>../../../parent</relativePath>
</parent>
@@ -31,6 +31,27 @@
<build>
+ <pluginManagement>
+ <plugins>
+ <plugin> <!-- generate JRebel Configuration -->
+ <groupId>org.zeroturnaround</groupId>
+ <artifactId>jrebel-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>generate-rebel-xml</id>
+ <phase>process-resources</phase>
+ <goals>
+ <goal>generate</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <relativePath>../../../</relativePath>
+ <rootPath>$${rebel.root}</rootPath>
+ </configuration>
+ </plugin>
+ </plugins>
+ </pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.felix</groupId>
http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldpath/ldpath-api/src/main/java/org/apache/marmotta/ldpath/api/functions/NodeFunction.java
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-api/src/main/java/org/apache/marmotta/ldpath/api/functions/NodeFunction.java b/libraries/ldpath/ldpath-api/src/main/java/org/apache/marmotta/ldpath/api/functions/NodeFunction.java
index 4d26d83..86805f6 100644
--- a/libraries/ldpath/ldpath-api/src/main/java/org/apache/marmotta/ldpath/api/functions/NodeFunction.java
+++ b/libraries/ldpath/ldpath-api/src/main/java/org/apache/marmotta/ldpath/api/functions/NodeFunction.java
@@ -44,7 +44,7 @@ public interface NodeFunction<T,Node> extends LDPathConstruct<Node> {
* @param args a nested list of KiWiNodes
* @return
*/
- public T apply(RDFBackend<Node> backend, Node context, Collection<Node>... args) throws IllegalArgumentException;
+ public T apply(RDFBackend<Node> backend, Node context, @SuppressWarnings("unchecked") Collection<Node>... args) throws IllegalArgumentException;
/**
* A string describing the signature of this node function, e.g. "fn:content(uris : Nodes) : Nodes". The
http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldpath/ldpath-api/src/main/java/org/apache/marmotta/ldpath/api/tests/NodeTest.java
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-api/src/main/java/org/apache/marmotta/ldpath/api/tests/NodeTest.java b/libraries/ldpath/ldpath-api/src/main/java/org/apache/marmotta/ldpath/api/tests/NodeTest.java
index 17f4da1..78a0414 100644
--- a/libraries/ldpath/ldpath-api/src/main/java/org/apache/marmotta/ldpath/api/tests/NodeTest.java
+++ b/libraries/ldpath/ldpath-api/src/main/java/org/apache/marmotta/ldpath/api/tests/NodeTest.java
@@ -31,6 +31,7 @@ import org.apache.marmotta.ldpath.api.functions.NodeFunction;
public abstract class NodeTest<Node> implements NodeFunction<Boolean, Node> {
@Override
+ @SafeVarargs
public final Boolean apply(RDFBackend<Node> backend, Node context, Collection<Node>... args)
throws IllegalArgumentException {
http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldpath/ldpath-api/src/main/java/org/apache/marmotta/ldpath/api/transformers/NodeTransformer.java
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-api/src/main/java/org/apache/marmotta/ldpath/api/transformers/NodeTransformer.java b/libraries/ldpath/ldpath-api/src/main/java/org/apache/marmotta/ldpath/api/transformers/NodeTransformer.java
index 44b07cc..c467fb1 100644
--- a/libraries/ldpath/ldpath-api/src/main/java/org/apache/marmotta/ldpath/api/transformers/NodeTransformer.java
+++ b/libraries/ldpath/ldpath-api/src/main/java/org/apache/marmotta/ldpath/api/transformers/NodeTransformer.java
@@ -17,10 +17,10 @@
*/
package org.apache.marmotta.ldpath.api.transformers;
-import org.apache.marmotta.ldpath.api.backend.NodeBackend;
-
import java.util.Map;
+import org.apache.marmotta.ldpath.api.backend.RDFBackend;
+
/**
* Implementations of this interface allow to transform KiWiNode objects into the type T. This is
* currently required by the indexer to map KiWiNodes to the Java types corresponding to the
@@ -37,10 +37,12 @@ public interface NodeTransformer<T,Node> {
* carrying out the transformation.
*
*
+ *
+ * @param backend
* @param node
* @param configuration the field configuration used when defining the LDPath rule
* @return
*/
- public T transform(NodeBackend<Node> backend, Node node, Map<String, String> configuration) throws IllegalArgumentException;
+ public T transform(RDFBackend<Node> backend, Node node, Map<String, String> configuration) throws IllegalArgumentException;
}
http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldpath/ldpath-backend-file/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-backend-file/pom.xml b/libraries/ldpath/ldpath-backend-file/pom.xml
index 0e5cdd7..236ff61 100644
--- a/libraries/ldpath/ldpath-backend-file/pom.xml
+++ b/libraries/ldpath/ldpath-backend-file/pom.xml
@@ -21,7 +21,7 @@
<parent>
<groupId>org.apache.marmotta</groupId>
<artifactId>marmotta-parent</artifactId>
- <version>3.1.0-incubating-SNAPSHOT</version>
+ <version>3.1.0-incubating</version>
<relativePath>../../../parent</relativePath>
</parent>
@@ -29,6 +29,30 @@
<artifactId>ldpath-backend-file</artifactId>
<packaging>jar</packaging>
+ <build>
+ <pluginManagement>
+ <plugins>
+ <plugin> <!-- generate JRebel Configuration -->
+ <groupId>org.zeroturnaround</groupId>
+ <artifactId>jrebel-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>generate-rebel-xml</id>
+ <phase>process-resources</phase>
+ <goals>
+ <goal>generate</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <relativePath>../../../</relativePath>
+ <rootPath>$${rebel.root}</rootPath>
+ </configuration>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ </build>
+
<dependencies>
<dependency>
http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldpath/ldpath-backend-file/src/test/java/org/apache/marmotta/ldpath/backend/file/ParserTest.java
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-backend-file/src/test/java/org/apache/marmotta/ldpath/backend/file/ParserTest.java b/libraries/ldpath/ldpath-backend-file/src/test/java/org/apache/marmotta/ldpath/backend/file/ParserTest.java
index 4d23c14..11d96f5 100644
--- a/libraries/ldpath/ldpath-backend-file/src/test/java/org/apache/marmotta/ldpath/backend/file/ParserTest.java
+++ b/libraries/ldpath/ldpath-backend-file/src/test/java/org/apache/marmotta/ldpath/backend/file/ParserTest.java
@@ -30,7 +30,8 @@ import org.apache.marmotta.ldpath.model.selectors.TestingSelector;
import org.apache.marmotta.ldpath.model.selectors.UnionSelector;
import org.apache.marmotta.ldpath.model.transformers.StringTransformer;
import org.apache.marmotta.ldpath.parser.ParseException;
-import org.apache.marmotta.ldpath.parser.RdfPathParser;
+import org.apache.marmotta.ldpath.parser.LdPathParser;
+import org.hamcrest.CoreMatchers;
import org.junit.Assert;
import org.junit.BeforeClass;
import org.junit.Test;
@@ -60,7 +61,7 @@ public class ParserTest {
String path1 = "rdfs:label";
NodeSelector<Value> s1 = parseSelector(path1, null);
- Assert.assertTrue(s1 instanceof PropertySelector);
+ Assert.assertThat(s1, CoreMatchers.instanceOf(PropertySelector.class));
Assert.assertEquals("<http://www.w3.org/2000/01/rdf-schema#label>",s1.getPathExpression(backend));
@@ -70,21 +71,19 @@ public class ParserTest {
);
String path2 = "(*[rdf:type is dbp-ont:Person]) | (dct:subject/^dct:subject[rdf:type is dbp-ont:Person]) | (dct:subject/^skos:broader/^dct:subject[rdf:type is dbp-ont:Person])";
NodeSelector<Value> s2 = parseSelector(path2,namespaces2);
- Assert.assertTrue(s2 instanceof UnionSelector);
+ Assert.assertThat(s2, CoreMatchers.instanceOf(UnionSelector.class));
String path3 = "*[rdf:type is dbp-ont:Person] | dct:subject/^dct:subject[rdf:type is dbp-ont:Person] | dct:subject/^skos:broader/^dct:subject[rdf:type is dbp-ont:Person]";
NodeSelector<Value> s3 = parseSelector(path3,namespaces2);
- Assert.assertTrue(s3 instanceof UnionSelector);
+ Assert.assertThat(s3, CoreMatchers.instanceOf(UnionSelector.class));
- Assert.assertEquals(s2,s3);
-
String path4 = "(* | dct:subject/^dct:subject | dct:subject/^skos:broader/^dct:subject)[rdf:type is dbp-ont:Person]";
NodeSelector<Value> s4 = parseSelector(path4,namespaces2);
- Assert.assertTrue(s4 instanceof TestingSelector);
+ Assert.assertThat(s4, CoreMatchers.instanceOf(TestingSelector.class));
}
private NodeSelector<Value> parseSelector(String selector, Map<String,String> namespaces) throws ParseException {
- return new RdfPathParser<Value>(backend,new StringReader(selector)).parseSelector(namespaces);
+ return new LdPathParser<Value>(backend,new StringReader(selector)).parseSelector(namespaces);
}
@Test
@@ -109,13 +108,13 @@ public class ParserTest {
Assert.assertNotNull(p3.getFilter());
Assert.assertEquals(5, p3.getNamespaces().size());
Assert.assertNotNull(p3.getField("person"));
- Assert.assertTrue(p3.getField("person").getSelector() instanceof PathSelector);
- Assert.assertTrue(p3.getField("person").getTransformer() instanceof StringTransformer);
+ Assert.assertThat(p3.getField("person").getSelector() , CoreMatchers.instanceOf(PathSelector.class));
+ Assert.assertThat(p3.getField("person").getTransformer(), CoreMatchers.instanceOf( StringTransformer.class));
}
private Program<Value> parseProgram(String selector) throws ParseException {
- return new RdfPathParser<Value>(backend,new StringReader(selector)).parseProgram();
+ return new LdPathParser<Value>(backend,new StringReader(selector)).parseProgram();
}
http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldpath/ldpath-backend-jena/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-backend-jena/pom.xml b/libraries/ldpath/ldpath-backend-jena/pom.xml
index d0a3062..6338891 100644
--- a/libraries/ldpath/ldpath-backend-jena/pom.xml
+++ b/libraries/ldpath/ldpath-backend-jena/pom.xml
@@ -21,7 +21,7 @@
<parent>
<groupId>org.apache.marmotta</groupId>
<artifactId>marmotta-parent</artifactId>
- <version>3.1.0-incubating-SNAPSHOT</version>
+ <version>3.1.0-incubating</version>
<relativePath>../../../parent</relativePath>
</parent>
@@ -29,6 +29,30 @@
<artifactId>ldpath-backend-jena</artifactId>
<packaging>jar</packaging>
+ <build>
+ <pluginManagement>
+ <plugins>
+ <plugin> <!-- generate JRebel Configuration -->
+ <groupId>org.zeroturnaround</groupId>
+ <artifactId>jrebel-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>generate-rebel-xml</id>
+ <phase>process-resources</phase>
+ <goals>
+ <goal>generate</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <relativePath>../../../</relativePath>
+ <rootPath>$${rebel.root}</rootPath>
+ </configuration>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ </build>
+
<dependencies>
http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldpath/ldpath-backend-linkeddata/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-backend-linkeddata/pom.xml b/libraries/ldpath/ldpath-backend-linkeddata/pom.xml
index 9c27f08..5be1f7e 100644
--- a/libraries/ldpath/ldpath-backend-linkeddata/pom.xml
+++ b/libraries/ldpath/ldpath-backend-linkeddata/pom.xml
@@ -21,7 +21,7 @@
<parent>
<groupId>org.apache.marmotta</groupId>
<artifactId>marmotta-parent</artifactId>
- <version>3.1.0-incubating-SNAPSHOT</version>
+ <version>3.1.0-incubating</version>
<relativePath>../../../parent</relativePath>
</parent>
@@ -30,6 +30,27 @@
<packaging>jar</packaging>
<build>
+ <pluginManagement>
+ <plugins>
+ <plugin> <!-- generate JRebel Configuration -->
+ <groupId>org.zeroturnaround</groupId>
+ <artifactId>jrebel-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>generate-rebel-xml</id>
+ <phase>process-resources</phase>
+ <goals>
+ <goal>generate</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <relativePath>../../../</relativePath>
+ <rootPath>$${rebel.root}</rootPath>
+ </configuration>
+ </plugin>
+ </plugins>
+ </pluginManagement>
<plugins>
<plugin>
<groupId>org.jasig.maven</groupId>
http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldpath/ldpath-backend-linkeddata/src/main/doc/LICENSE.txt
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-backend-linkeddata/src/main/doc/LICENSE.txt b/libraries/ldpath/ldpath-backend-linkeddata/src/main/doc/LICENSE.txt
index 147194e..6b85159 100644
--- a/libraries/ldpath/ldpath-backend-linkeddata/src/main/doc/LICENSE.txt
+++ b/libraries/ldpath/ldpath-backend-linkeddata/src/main/doc/LICENSE.txt
@@ -702,4 +702,35 @@ For the JSONLD-Java component,
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
THE POSSIBILITY OF SUCH DAMAGE.
+For the Marmotta Commons component,
+
+ located at commons/marmotta-commons/src/ext/java
+
+ Javolution - Java(tm) Solution for Real-Time and Embedded Systems
+ Copyright (c) 2012, Javolution (http://javolution.org/)
+ All rights reserved.
+
+ Redistribution and use in source and binary forms, with or without
+ modification, are permitted provided that the following conditions are met:
+
+ 1. Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+
+ 2. Redistributions in binary form must reproduce the above copyright
+ notice, this list of conditions and the following disclaimer in the
+ documentation and/or other materials provided with the distribution.
+
+ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
+ CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+ NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldpath/ldpath-backend-linkeddata/src/main/doc/NOTICE.txt
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-backend-linkeddata/src/main/doc/NOTICE.txt b/libraries/ldpath/ldpath-backend-linkeddata/src/main/doc/NOTICE.txt
index dc6c538..e54d3d5 100644
--- a/libraries/ldpath/ldpath-backend-linkeddata/src/main/doc/NOTICE.txt
+++ b/libraries/ldpath/ldpath-backend-linkeddata/src/main/doc/NOTICE.txt
@@ -1,6 +1,8 @@
-Apache Marmotta LDPath, Copyright 2012-2013 The Apache Software Foundation
+Apache Marmotta LDPath
+Copyright 2012-2013 The Apache Software Foundation
-This product includes software developed at The Apache Software Foundation (http://www.apache.org).
+This product includes software developed at
+The Apache Software Foundation (http://www.apache.org).
Portions of this software were originally based on the following:
@@ -8,103 +10,9 @@ Portions of this software were originally based on the following:
These have been licensed to the Apache Software Foundation under a software grant.
-* CAL10N, http://cal10n.qos.ch
-
- Copyright (c) 2009 QOS.ch
-
-* Logback, http://logback.qos.ch
-
- Copyright (C) 2012 QOS.ch
-
-* Guava, http://guava-libraries.googlecode.com
-
- Copyright (c) 2013 Google Inc.
-
-* OneJAR, http://one-jar.sourceforge.net
-
- Copyright (c) 2004-2010 P. Simon Tuffs
-
-* SLF4J, http://www.slf4j.org
-
- Copyright (c) 2013 QOS.ch
-
-* Jaxen, http://jaxen.codehaus.org
-
- Copyright (c) 2006 The Werken Company
-
-* JDOM, http://www.jdom.org
-
- Copyright (c) 2012 Jason Hunter & Brett McLaughlin
-
-* JSoup, http://jsoup.org
-
- Copyright (c) 2013 Jonathan Hedley
-
-* Jackson, http://jackson.codehaus.org
-
- Copyright (c) 2010 FasterXML LLC.
-
-* OpenRDF Sesame, http://www.openrdf.org
-
- Copyright (c) 2013 Aduna
-
- This software includes code developed by Aduna
- (http://www.aduna-software.com/).
-
- This software includes code developed by Ontotext AD
- (http://www.ontotext.com/).
-
- This software includes code developed by 3 Round Stones
- (http://www.3roundstones.com/).
-
- This software includes code developed by Fluid Operations
- (http://www.fluidops.com/).
-
- This software includes code developed by the Information Management Group at
- Food & Biobased Research, Wageningen University (http://www.fbr.wur.nl/).
-
- This software includes code developed by Clark & Parsia
- (http://clarkparsia.com/).
-
- This software includes code developed by the Institute for Defense Analyses
- (IDA) (http://www.ida.org/).
-
- This software includes code developed by Atos (http://www.atos.net/).
-
- This software includes code developed by Peter Ansell.
-
- The above parties have licensed their code contributions to Aduna under the
- terms of a contributor license agreement (CLA).
-
- This product includes software developed by the JUnit project
- (http://www.junit.org). License: http://junit.sourceforge.net/cpl-v10.html
-
- Parts of this product use software developed by JSON.org
- (http://www.json.org). License: http://www.json.org/license.html
-
- Parts of this product use software developed by the Mockito project
- (http://mockito.googlecode.com). License: https://github.com/mockito/mockito/blob/master/LICENSE
-
-* Semargl, http://semarglproject.org
-
- Copyright (c) 2012 Lev Khomich
-
- This product uses software developed by The Apache Software Foundation:
- Clerezza, Jena, IO Commons (http://www.apache.org/).
-
- This product includes/uses test suite developed by Hewlett-Packard
- (http://hp.com/). Copyright (c) 2002, Hewlett-Packard Company.
-
- This product includes/uses test suite developed by W3C Consortium.
-
- This product includes/uses RDFa test harness developed by RDF Web Applications
- Working Group (http://www.w3.org/2010/02/rdfa/).
-
-* ROME, http://rometools.jira.com
-
- Copyright (c) 2004 Sun Microsystems
-
-* JSONLD-Java, http://github.com/tristan/jsonld-java
-
- Copyright (c) 2012, Deutsches Forschungszentrum für Künstliche Intelligenz GmbH
+This product also includes some third-party source components:
+ * The module commons/marmotta-commons contains a modified and reduced version
+ of the Javolution library. Javolution has copyright (c) 2012, Javolution and
+ is licensed under BSD license. The original source code is available from
+ http://javolution.org
http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldpath/ldpath-backend-sesame/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-backend-sesame/pom.xml b/libraries/ldpath/ldpath-backend-sesame/pom.xml
index 910de1b..da8f536 100644
--- a/libraries/ldpath/ldpath-backend-sesame/pom.xml
+++ b/libraries/ldpath/ldpath-backend-sesame/pom.xml
@@ -21,7 +21,7 @@
<parent>
<groupId>org.apache.marmotta</groupId>
<artifactId>marmotta-parent</artifactId>
- <version>3.1.0-incubating-SNAPSHOT</version>
+ <version>3.1.0-incubating</version>
<relativePath>../../../parent</relativePath>
</parent>
@@ -29,8 +29,31 @@
<artifactId>ldpath-backend-sesame</artifactId>
<packaging>jar</packaging>
- <dependencies>
+ <build>
+ <pluginManagement>
+ <plugins>
+ <plugin> <!-- generate JRebel Configuration -->
+ <groupId>org.zeroturnaround</groupId>
+ <artifactId>jrebel-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>generate-rebel-xml</id>
+ <phase>process-resources</phase>
+ <goals>
+ <goal>generate</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <relativePath>../../../</relativePath>
+ <rootPath>$${rebel.root}</rootPath>
+ </configuration>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ </build>
+ <dependencies>
<dependency>
<groupId>org.apache.marmotta</groupId>
<artifactId>ldpath-api</artifactId>
@@ -43,11 +66,6 @@
<groupId>org.openrdf.sesame</groupId>
<artifactId>sesame-repository-api</artifactId>
</dependency>
-
- <dependency>
- <groupId>com.google.guava</groupId>
- <artifactId>guava</artifactId>
- </dependency>
</dependencies>
http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldpath/ldpath-backend-sesame/src/main/java/org/apache/marmotta/ldpath/backend/sesame/AbstractSesameBackend.java
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-backend-sesame/src/main/java/org/apache/marmotta/ldpath/backend/sesame/AbstractSesameBackend.java b/libraries/ldpath/ldpath-backend-sesame/src/main/java/org/apache/marmotta/ldpath/backend/sesame/AbstractSesameBackend.java
index 93daedf..3e99b72 100644
--- a/libraries/ldpath/ldpath-backend-sesame/src/main/java/org/apache/marmotta/ldpath/backend/sesame/AbstractSesameBackend.java
+++ b/libraries/ldpath/ldpath-backend-sesame/src/main/java/org/apache/marmotta/ldpath/backend/sesame/AbstractSesameBackend.java
@@ -26,11 +26,7 @@ import java.util.concurrent.ThreadPoolExecutor;
import org.apache.marmotta.ldpath.api.backend.RDFBackend;
-import org.openrdf.model.Literal;
-import org.openrdf.model.Resource;
-import org.openrdf.model.Statement;
-import org.openrdf.model.Value;
-import org.openrdf.model.ValueFactory;
+import org.openrdf.model.*;
import org.openrdf.repository.RepositoryConnection;
import org.openrdf.repository.RepositoryException;
import org.openrdf.repository.RepositoryResult;
@@ -65,8 +61,10 @@ public abstract class AbstractSesameBackend extends SesameValueBackend implement
protected Collection<Value> listObjectsInternal(RepositoryConnection connection, Resource subject, org.openrdf.model.URI property)
throws RepositoryException {
+ ValueFactory valueFactory = connection.getValueFactory();
+
Set<Value> result = new HashSet<Value>();
- RepositoryResult<Statement> qResult = connection.getStatements(subject, property, null, true);
+ RepositoryResult<Statement> qResult = connection.getStatements(merge(subject, connection.getValueFactory()), merge(property, connection.getValueFactory()), null, true);
try {
while(qResult.hasNext()) {
result.add(qResult.next().getObject());
@@ -80,7 +78,7 @@ public abstract class AbstractSesameBackend extends SesameValueBackend implement
protected Collection<Value> listSubjectsInternal(final RepositoryConnection connection, org.openrdf.model.URI property, Value object)
throws RepositoryException {
Set<Value> result = new HashSet<Value>();
- RepositoryResult<Statement> qResult = connection.getStatements(null, property, object, true);
+ RepositoryResult<Statement> qResult = connection.getStatements(null, merge(property, connection.getValueFactory()), merge(object, connection.getValueFactory()), true);
try {
while(qResult.hasNext()) {
result.add(qResult.next().getSubject());
@@ -91,6 +89,23 @@ public abstract class AbstractSesameBackend extends SesameValueBackend implement
return result;
}
+ /**
+ * Merge the value given as argument into the value factory given as argument
+ * @param value
+ * @param vf
+ * @param <T>
+ * @return
+ */
+ protected <T extends Value> T merge(T value, ValueFactory vf) {
+ if(value instanceof org.openrdf.model.URI) {
+ return (T)vf.createURI(value.stringValue());
+ } else if(value instanceof BNode) {
+ return (T)vf.createBNode(((BNode) value).getID());
+ } else {
+ return value;
+ }
+ }
+
@Override
public abstract Literal createLiteral(String content);
http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldpath/ldpath-backend-sesame/src/main/java/org/apache/marmotta/ldpath/backend/sesame/SesameValueBackend.java
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-backend-sesame/src/main/java/org/apache/marmotta/ldpath/backend/sesame/SesameValueBackend.java b/libraries/ldpath/ldpath-backend-sesame/src/main/java/org/apache/marmotta/ldpath/backend/sesame/SesameValueBackend.java
index 4afda47..b341a27 100644
--- a/libraries/ldpath/ldpath-backend-sesame/src/main/java/org/apache/marmotta/ldpath/backend/sesame/SesameValueBackend.java
+++ b/libraries/ldpath/ldpath-backend-sesame/src/main/java/org/apache/marmotta/ldpath/backend/sesame/SesameValueBackend.java
@@ -1,3 +1,20 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You 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.ldpath.backend.sesame;
import java.math.BigDecimal;
http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldpath/ldpath-core/pom.xml
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-core/pom.xml b/libraries/ldpath/ldpath-core/pom.xml
index 00a8dbf..95dd222 100644
--- a/libraries/ldpath/ldpath-core/pom.xml
+++ b/libraries/ldpath/ldpath-core/pom.xml
@@ -21,7 +21,7 @@
<parent>
<groupId>org.apache.marmotta</groupId>
<artifactId>marmotta-parent</artifactId>
- <version>3.1.0-incubating-SNAPSHOT</version>
+ <version>3.1.0-incubating</version>
<relativePath>../../../parent</relativePath>
</parent>
@@ -68,6 +68,10 @@
<scope>test</scope>
</dependency>
<dependency>
+ <groupId>org.hamcrest</groupId>
+ <artifactId>hamcrest-library</artifactId>
+ </dependency>
+ <dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<scope>test</scope>
@@ -103,6 +107,27 @@
<build>
+ <pluginManagement>
+ <plugins>
+ <plugin> <!-- generate JRebel Configuration -->
+ <groupId>org.zeroturnaround</groupId>
+ <artifactId>jrebel-maven-plugin</artifactId>
+ <executions>
+ <execution>
+ <id>generate-rebel-xml</id>
+ <phase>process-resources</phase>
+ <goals>
+ <goal>generate</goal>
+ </goals>
+ </execution>
+ </executions>
+ <configuration>
+ <relativePath>../../../</relativePath>
+ <rootPath>$${rebel.root}</rootPath>
+ </configuration>
+ </plugin>
+ </plugins>
+ </pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/LDPath.java
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/LDPath.java b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/LDPath.java
index bc46c41..29cf999 100644
--- a/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/LDPath.java
+++ b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/LDPath.java
@@ -36,7 +36,7 @@ import org.apache.marmotta.ldpath.model.programs.Program;
import org.apache.marmotta.ldpath.parser.Configuration;
import org.apache.marmotta.ldpath.parser.DefaultConfiguration;
import org.apache.marmotta.ldpath.parser.ParseException;
-import org.apache.marmotta.ldpath.parser.RdfPathParser;
+import org.apache.marmotta.ldpath.parser.LdPathParser;
import com.google.common.collect.ImmutableList;
import com.google.common.collect.ImmutableMap;
@@ -104,7 +104,7 @@ public class LDPath<Node> {
* @throws LDPathParseException when the path passed as argument is not valid
*/
public Collection<Node> pathQuery(Node context, String path, Map<String, String> namespaces) throws LDPathParseException {
- RdfPathParser<Node> parser = new RdfPathParser<Node>(backend,config,new StringReader(path));
+ LdPathParser<Node> parser = new LdPathParser<Node>(backend,config,new StringReader(path));
for(SelectorFunction<Node> function : functions) {
parser.registerFunction(function);
}
@@ -150,7 +150,7 @@ public class LDPath<Node> {
* @throws LDPathParseException when the path passed as argument is not valid
*/
public Collection<Node> pathQuery(Node context, String path, Map<String, String> namespaces, Map<Node,List<Node>> paths) throws LDPathParseException {
- RdfPathParser<Node> parser = new RdfPathParser<Node>(backend,config,new StringReader(path));
+ LdPathParser<Node> parser = new LdPathParser<Node>(backend,config,new StringReader(path));
for(SelectorFunction<Node> function : functions) {
parser.registerFunction(function);
}
@@ -194,7 +194,7 @@ public class LDPath<Node> {
* @throws LDPathParseException when the path passed as argument is not valid
*/
public <T> Collection<T> pathTransform(Node context, String path, Map<String, String> namespaces) throws LDPathParseException {
- RdfPathParser<Node> parser = new RdfPathParser<Node>(backend,config,new StringReader(path));
+ LdPathParser<Node> parser = new LdPathParser<Node>(backend,config,new StringReader(path));
for(SelectorFunction<Node> function : functions) {
parser.registerFunction(function);
}
@@ -223,7 +223,7 @@ public class LDPath<Node> {
* @throws LDPathParseException
*/
public Map<String,Collection<?>> programQuery(Node context, Reader program) throws LDPathParseException {
- RdfPathParser<Node> parser = new RdfPathParser<Node>(backend,config,program);
+ LdPathParser<Node> parser = new LdPathParser<Node>(backend,config,program);
for(SelectorFunction<Node> function : functions) {
parser.registerFunction(function);
}
@@ -255,7 +255,7 @@ public class LDPath<Node> {
* @throws LDPathParseException
*/
public Program<Node> parseProgram(Reader program) throws LDPathParseException {
- RdfPathParser<Node> parser = new RdfPathParser<Node>(backend,config,program);
+ LdPathParser<Node> parser = new LdPathParser<Node>(backend,config,program);
for(SelectorFunction<Node> function : functions) {
parser.registerFunction(function);
}
http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/fields/FieldMapping.java
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/fields/FieldMapping.java b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/fields/FieldMapping.java
index 538be06..ad7984b 100644
--- a/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/fields/FieldMapping.java
+++ b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/fields/FieldMapping.java
@@ -21,6 +21,7 @@ import com.google.common.base.Function;
import com.google.common.collect.Collections2;
import com.google.common.collect.ImmutableList;
+import java.net.URI;
import java.util.Collection;
import java.util.List;
import java.util.Map;
@@ -38,6 +39,8 @@ import org.apache.marmotta.ldpath.api.transformers.NodeTransformer;
*/
public class FieldMapping<T,Node> implements LDPathConstruct<Node> {
+ private boolean isSimpleName = true;
+
/**
* The name of the field in the search index
*/
@@ -46,7 +49,7 @@ public class FieldMapping<T,Node> implements LDPathConstruct<Node> {
/**
* The type of the field in the search index
*/
- private String fieldType;
+ private URI fieldType;
/**
* The selector to use for selecting nodes
@@ -63,10 +66,15 @@ public class FieldMapping<T,Node> implements LDPathConstruct<Node> {
*/
private Map<String, String> fieldConfig;
- public FieldMapping() {
+ private FieldMapping() {
}
-
- public FieldMapping(String fieldName, String fieldType, NodeSelector<Node> selector, NodeTransformer<T,Node> transformer, Map<String, String> fieldConfig) {
+
+ public FieldMapping(URI fieldName, URI fieldType, NodeSelector<Node> selector, NodeTransformer<T,Node> transformer, Map<String, String> fieldConfig) {
+ this(fieldName.toString(), fieldType, selector, transformer, fieldConfig);
+ this.isSimpleName = false;
+ }
+
+ public FieldMapping(String fieldName, URI fieldType, NodeSelector<Node> selector, NodeTransformer<T,Node> transformer, Map<String, String> fieldConfig) {
this();
this.fieldName = fieldName;
this.fieldType = fieldType;
@@ -80,7 +88,7 @@ public class FieldMapping<T,Node> implements LDPathConstruct<Node> {
return fieldName;
}
- public String getFieldType() {
+ public URI getFieldType() {
return fieldType;
}
@@ -162,7 +170,10 @@ public class FieldMapping<T,Node> implements LDPathConstruct<Node> {
}
fc.append(")");
}
- return String.format("%s = %s :: <%s>%s ;", fieldName, selector.getPathExpression(backend), fieldType, fc.toString());
+ if (isSimpleName)
+ return String.format("%s = %s :: <%s>%s ;", fieldName, selector.getPathExpression(backend), fieldType, fc.toString());
+ else
+ return String.format("<%s> = %s :: <%s>%s ;", fieldName, selector.getPathExpression(backend), fieldType, fc.toString());
}
}
http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/functions/ConcatenateFunction.java
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/functions/ConcatenateFunction.java b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/functions/ConcatenateFunction.java
index 81437a6..127c621 100644
--- a/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/functions/ConcatenateFunction.java
+++ b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/functions/ConcatenateFunction.java
@@ -46,7 +46,8 @@ public class ConcatenateFunction<Node> extends SelectorFunction<Node> {
* @return
*/
@Override
- public Collection<Node> apply(RDFBackend<Node> rdfBackend, Node context, Collection<Node>... args) throws IllegalArgumentException {
+ @SafeVarargs
+ public final Collection<Node> apply(RDFBackend<Node> rdfBackend, Node context, Collection<Node>... args) throws IllegalArgumentException {
Iterator<Node> it = org.apache.marmotta.ldpath.util.Collections.iterator(args);
StringBuilder result = new StringBuilder();
while (it.hasNext()) {
http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/functions/CountFunction.java
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/functions/CountFunction.java b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/functions/CountFunction.java
index 1f0d130..6e0fc90 100644
--- a/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/functions/CountFunction.java
+++ b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/functions/CountFunction.java
@@ -31,7 +31,8 @@ public class CountFunction<Node> extends SelectorFunction<Node> {
private final URI dataType = URI.create("http://www.w3.org/2001/XMLSchema#integer");
@Override
- public Collection<Node> apply(RDFBackend<Node> backend, Node context, Collection<Node>... args) throws IllegalArgumentException {
+ @SafeVarargs
+ public final Collection<Node> apply(RDFBackend<Node> backend, Node context, Collection<Node>... args) throws IllegalArgumentException {
LinkedList<Node> result = new LinkedList<Node>();
for (Collection<Node> coll : args) {
http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/functions/FirstFunction.java
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/functions/FirstFunction.java b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/functions/FirstFunction.java
index 735c13a..44e34c4 100644
--- a/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/functions/FirstFunction.java
+++ b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/functions/FirstFunction.java
@@ -29,7 +29,7 @@ import org.apache.marmotta.ldpath.api.functions.SelectorFunction;
*
*
* @param <Node> the node type used by the backend
- * @author jakob
+ * @author Jakob Frank <ja...@apache.org>
*
*/
public class FirstFunction<Node> extends SelectorFunction<Node> {
@@ -44,7 +44,8 @@ public class FirstFunction<Node> extends SelectorFunction<Node> {
* @return
*/
@Override
- public Collection<Node> apply(RDFBackend<Node> rdfBackend, Node context, Collection<Node>... args) throws IllegalArgumentException {
+ @SafeVarargs
+ public final Collection<Node> apply(RDFBackend<Node> rdfBackend, Node context, Collection<Node>... args) throws IllegalArgumentException {
for (Collection<Node> arg : args) {
if (arg.size() > 0) { return arg; }
}
http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/functions/LastFunction.java
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/functions/LastFunction.java b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/functions/LastFunction.java
index ef3cbfe..a0e502e 100644
--- a/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/functions/LastFunction.java
+++ b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/functions/LastFunction.java
@@ -27,7 +27,7 @@ import org.apache.marmotta.ldpath.api.functions.SelectorFunction;
/**
* Selects the <code>last</code> node in the argument list.
*
- * @author jfrank
+ * @author Jakob Frank <ja...@apache.org>
*
*/
public class LastFunction<Node> extends SelectorFunction<Node> {
@@ -41,7 +41,8 @@ public class LastFunction<Node> extends SelectorFunction<Node> {
* @return
*/
@Override
- public Collection<Node> apply(RDFBackend<Node> rdfBackend, Node context, Collection<Node>... args) throws IllegalArgumentException {
+ @SafeVarargs
+ public final Collection<Node> apply(RDFBackend<Node> rdfBackend, Node context, Collection<Node>... args) throws IllegalArgumentException {
for (int i = args.length - 1; i >= 0; i--) {
if (args[i].size() > 0) { return args[i]; }
}
http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/functions/SortFunction.java
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/functions/SortFunction.java b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/functions/SortFunction.java
index 30ec623..786f4ad 100644
--- a/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/functions/SortFunction.java
+++ b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/functions/SortFunction.java
@@ -65,7 +65,8 @@ public class SortFunction<Node> extends SelectorFunction<Node> {
* @return
*/
@Override
- public Collection<Node> apply(final RDFBackend<Node> nodeRDFBackend, Node context, Collection<Node>... args) throws IllegalArgumentException {
+ @SafeVarargs
+ public final Collection<Node> apply(final RDFBackend<Node> nodeRDFBackend, Node context, Collection<Node>... args) throws IllegalArgumentException {
String order = "string";
String direction = "asc";
http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/programs/Program.java
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/programs/Program.java b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/programs/Program.java
index b09d9e9..ae4ffcb 100644
--- a/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/programs/Program.java
+++ b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/programs/Program.java
@@ -60,6 +60,11 @@ public class Program<Node> implements LDPathConstruct<Node> {
private Map<String, String> namespaces;
/**
+ * Restrict evaluation of the program to the graphs/contexts
+ */
+ private Set<Node> graphs;
+
+ /**
* An (optional) filter to use for checking which resources should be
* indexed.
*/
@@ -69,7 +74,7 @@ public class Program<Node> implements LDPathConstruct<Node> {
* An (optional) selector to resolve a document boost factor.
*/
private FieldMapping<Float,Node> booster;
-
+
/**
* The field mappings contained in this program.
*/
@@ -78,6 +83,7 @@ public class Program<Node> implements LDPathConstruct<Node> {
public Program() {
namespaces = new LinkedHashMap<String, String>();
fields = new LinkedHashSet<FieldMapping<?,Node>>();
+ graphs = new LinkedHashSet<Node>();
}
public void addNamespace(String prefix, String uri) {
@@ -91,7 +97,7 @@ public class Program<Node> implements LDPathConstruct<Node> {
public Set<FieldMapping<?,Node>> getFields() {
return fields;
}
-
+
public FieldMapping<?,Node> getField(String name) {
for(FieldMapping<?,Node> m : fields) {
if(name.equals(m.getFieldName())) {
@@ -128,7 +134,21 @@ public class Program<Node> implements LDPathConstruct<Node> {
public void setNamespaces(Map<String, String> namespaces) {
this.namespaces = new LinkedHashMap<String, String>(namespaces);
}
-
+
+ public Set<Node> getGraphs() {
+ return this.graphs;
+ }
+
+ @SuppressWarnings("unchecked")
+ public Node[] getGraphArr() {
+ return (Node[]) this.graphs.toArray();
+ }
+
+ public void setGraphs(Collection<Node> graphs) {
+ this.graphs.clear();
+ this.graphs.addAll(graphs);
+ }
+
/**
* Executes this Program on the parsed {@link RDFBackend backend}.
* @param context The context of the execution
@@ -158,22 +178,41 @@ public class Program<Node> implements LDPathConstruct<Node> {
return result;
}
-
-
+
+
public String getPathExpression(NodeBackend<Node> backend) {
StringBuilder sb = new StringBuilder();
- // Filter (?)
+ // Graphs (optional)
+ if (graphs != null && graphs.size() > 0) {
+ sb.append("@graph");
+ boolean first = true;
+ for (Node gaph : graphs) {
+ if (backend.isURI(gaph)) {
+ if (first) {
+ sb.append(" <");
+ } else{
+ sb.append(", <");
+ }
+ sb.append(backend.stringValue(gaph)).append(">");
+
+ first = false;
+ }
+ }
+ sb.append(" ;\n");
+ }
+
+ // Filter (optional)
if (filter != null) {
sb.append(String.format("@filter %s ;%n", filter.getPathExpression(backend)));
}
- // Booster (?)
+ // Booster (optional)
if (booster != null) {
sb.append(String.format("@boost %s ;%n", booster.getSelector().getPathExpression(backend)));
}
// Field-Definitions
- for (FieldMapping<?,Node> field : fields) {
+ for (FieldMapping<?,Node> field : fields) {
sb.append(String.format(" %s%n", field.getPathExpression(backend)));
}
String progWithoutNamespace = sb.toString();
@@ -190,7 +229,7 @@ public class Program<Node> implements LDPathConstruct<Node> {
progWithoutNamespace = progWithoutNamespace.replaceAll("<" + Pattern.quote(ns.getValue()) + "([^>]*)>", Matcher.quoteReplacement(ns.getKey())
+ ":$1");
}
-
+
// Also resolve default namespaces...
for (Entry<String, String> ns : DEFAULT_NAMESPACES.entrySet()) {
@@ -201,8 +240,8 @@ public class Program<Node> implements LDPathConstruct<Node> {
}
final StringBuilder prefixes = new StringBuilder();
for (Entry<String, String> ns : namespaces.entrySet()) {
- prefixes.append(String.format("@prefix %s : <%s> ;%n", ns.getKey(), ns.getValue()));
- }
+ prefixes.append(String.format("@prefix %s: <%s> ;%n", ns.getKey(), ns.getValue()));
+ }
return prefixes.append(progWithoutNamespace).toString();
}
http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/selectors/GroupedSelector.java
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/selectors/GroupedSelector.java b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/selectors/GroupedSelector.java
new file mode 100644
index 0000000..4ba66d5
--- /dev/null
+++ b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/selectors/GroupedSelector.java
@@ -0,0 +1,101 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.ldpath.model.selectors;
+
+
+import java.util.Collection;
+import java.util.List;
+import java.util.Map;
+
+import org.apache.marmotta.ldpath.api.backend.NodeBackend;
+import org.apache.marmotta.ldpath.api.backend.RDFBackend;
+import org.apache.marmotta.ldpath.api.selectors.NodeSelector;
+
+/**
+ * A Group is a complex selector in brackets.
+ *
+ * @param <Node> the node type used by the backend
+ * @author Jakob Frank <ja...@apache.org>
+ */
+public class GroupedSelector<Node> implements NodeSelector<Node> {
+
+ private final NodeSelector<Node> content;
+
+ public GroupedSelector(NodeSelector<Node> content) {
+ this.content = content;
+ }
+
+
+ /**
+ * Apply the selector to the context node passed as argument and return the collection
+ * of selected nodes in appropriate order.
+ *
+ * @param context the node where to start the selection
+ * @param path the path leading to but not including the context node in the current evaluation of LDPath; may be null,
+ * in which case path tracking is disabled
+ * @param resultPaths a map where each of the result nodes maps to a path leading to the result node in the LDPath evaluation;
+ * if null, path tracking is disabled and the path argument is ignored
+ * @return the collection of selected nodes
+ */
+ @Override
+ public Collection<Node> select(final RDFBackend<Node> rdfBackend, final Node context, final List<Node> path, final Map<Node, List<Node>> resultPaths) {
+ return content.select(rdfBackend, context, path, resultPaths);
+ }
+
+ /**
+ * Return the name of the NodeSelector for registration in the selector registry
+ *
+ * @param rdfBackend
+ * @return
+ */
+ @Override
+ public String getPathExpression(NodeBackend<Node> rdfBackend) {
+ return String.format("(%s)", content.getPathExpression(rdfBackend));
+ }
+
+ /**
+ * Return a name for this selector to be used as the name for the whole path if not explicitly
+ * specified. In complex selector expressions, this is typically delegated to the first
+ * occurrence of an atomic selector.
+ */
+ @Override
+ public String getName(NodeBackend<Node> nodeRDFBackend) {
+ throw new UnsupportedOperationException("cannot use a group in unnamed field definitions because the name is ambiguous");
+ }
+
+
+ @Override
+ public boolean equals(Object o) {
+ if (this == o) return true;
+ if (o == null || getClass() != o.getClass()) return false;
+
+ @SuppressWarnings("rawtypes")
+ GroupedSelector that = (GroupedSelector) o;
+
+ if (content!= null ? !content.equals(that.content) : that.content!= null) return false;
+
+ return true;
+ }
+
+ @Override
+ public int hashCode() {
+ int result = 31;
+ result = 31 * result + (content != null ? content.hashCode() : 0);
+ return result;
+ }
+}
http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/selectors/IntersectionSelector.java
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/selectors/IntersectionSelector.java b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/selectors/IntersectionSelector.java
index b50a5d6..443b225 100644
--- a/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/selectors/IntersectionSelector.java
+++ b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/selectors/IntersectionSelector.java
@@ -65,7 +65,7 @@ public class IntersectionSelector<Node> implements NodeSelector<Node> {
@Override
public String getPathExpression(NodeBackend<Node> backend) {
- return String.format("(%s & %s)", left.getPathExpression(backend), right.getPathExpression(backend));
+ return String.format("%s & %s", left.getPathExpression(backend), right.getPathExpression(backend));
}
/**
http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/selectors/UnionSelector.java
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/selectors/UnionSelector.java b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/selectors/UnionSelector.java
index 963c38a..1964fd3 100644
--- a/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/selectors/UnionSelector.java
+++ b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/selectors/UnionSelector.java
@@ -74,7 +74,7 @@ public class UnionSelector<Node> implements NodeSelector<Node> {
*/
@Override
public String getPathExpression(NodeBackend<Node> rdfBackend) {
- return String.format("(%s | %s)", left.getPathExpression(rdfBackend), right.getPathExpression(rdfBackend));
+ return String.format("%s | %s", left.getPathExpression(rdfBackend), right.getPathExpression(rdfBackend));
}
/**
http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/tests/IsATest.java
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/tests/IsATest.java b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/tests/IsATest.java
new file mode 100644
index 0000000..7f84457
--- /dev/null
+++ b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/tests/IsATest.java
@@ -0,0 +1,57 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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.ldpath.model.tests;
+
+import org.apache.marmotta.ldpath.api.backend.NodeBackend;
+import org.apache.marmotta.ldpath.model.selectors.PropertySelector;
+
+/**
+ * Shortcut for {@link PathEqualityTest} with the property {@literal http://www.w3.org/1999/02/22-rdf-syntax-ns#type}
+ * @author Jakob Frank <ja...@apache.org>
+ *
+ * @param <Node>
+ */
+public class IsATest<Node> extends PathEqualityTest<Node> {
+
+ public IsATest(Node rdfType, Node node) {
+ super(new PropertySelector<Node>(rdfType), node);
+ }
+
+ @Override
+ public String getPathExpression(NodeBackend<Node> rdfBackend) {
+ if (rdfBackend.isURI(node)) {
+ return String.format("is-a <%s>", rdfBackend.stringValue(node));
+ } else if (rdfBackend.isLiteral(node)) {
+ return String.format("is-a \"%s\"", rdfBackend.stringValue(node));
+ } else {
+ // TODO Can this happen?
+ return String.format("is-a %s", rdfBackend.stringValue(node));
+ }
+ }
+
+ @Override
+ public String getSignature() {
+ return "is-a Node :: NodeList -> Boolean";
+ }
+
+ @Override
+ public String getDescription() {
+ return "tests if a node has a certain type";
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/tests/LiteralTypeTest.java
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/tests/LiteralTypeTest.java b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/tests/LiteralTypeTest.java
index 58bbad0..bbd63d8 100644
--- a/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/tests/LiteralTypeTest.java
+++ b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/tests/LiteralTypeTest.java
@@ -17,6 +17,8 @@
*/
package org.apache.marmotta.ldpath.model.tests;
+import java.net.URI;
+
import org.apache.marmotta.ldpath.api.backend.NodeBackend;
import org.apache.marmotta.ldpath.api.backend.RDFBackend;
import org.apache.marmotta.ldpath.api.tests.NodeTest;
@@ -35,10 +37,14 @@ import org.apache.marmotta.ldpath.api.tests.NodeTest;
*/
public class LiteralTypeTest<Node> extends NodeTest<Node> {
- private String typeUri;
+ private URI typeUri;
public LiteralTypeTest(String typeUri) {
- this.typeUri = typeUri;
+ this.typeUri = URI.create(typeUri);
+ }
+
+ public LiteralTypeTest(URI uri) {
+ this.typeUri = uri;
}
/**
@@ -55,9 +61,10 @@ public class LiteralTypeTest<Node> extends NodeTest<Node> {
if(rdfBackend.isLiteral(node)) {
if(typeUri != null) {
- return typeUri.equals(rdfBackend.getLiteralType(node).toString());
+ return typeUri.equals(rdfBackend.getLiteralType(node));
} else {
- return null == rdfBackend.getLiteralType(node).toString();
+ // FIXME: MARMOTTA-39
+ return null == rdfBackend.getLiteralType(node);
}
} else {
return false;
@@ -73,7 +80,7 @@ public class LiteralTypeTest<Node> extends NodeTest<Node> {
*/
@Override
public String getPathExpression(NodeBackend<Node> rdfBackend) {
- return "^^" + typeUri;
+ return String.format("^^<%s>", typeUri);
}
/**
http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/tests/PathEqualityTest.java
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/tests/PathEqualityTest.java b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/tests/PathEqualityTest.java
index 5b6a044..82bb714 100644
--- a/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/tests/PathEqualityTest.java
+++ b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/tests/PathEqualityTest.java
@@ -36,8 +36,8 @@ import org.apache.marmotta.ldpath.api.tests.NodeTest;
*/
public class PathEqualityTest<Node> extends NodeTest<Node> {
- private NodeSelector<Node> path;
- private Node node;
+ private final NodeSelector<Node> path;
+ protected final Node node;
public PathEqualityTest(NodeSelector<Node> path, Node node) {
@@ -68,6 +68,8 @@ public class PathEqualityTest<Node> extends NodeTest<Node> {
public String getPathExpression(NodeBackend<Node> rdfBackend) {
if (rdfBackend.isURI(node)) {
return String.format("%s is <%s>", path.getPathExpression(rdfBackend), rdfBackend.stringValue(node));
+ } else if (rdfBackend.isLiteral(node)) {
+ return String.format("%s is \"%s\"", path.getPathExpression(rdfBackend), rdfBackend.stringValue(node));
} else {
// TODO Can this happen?
return String.format("%s is %s", path.getPathExpression(rdfBackend), rdfBackend.stringValue(node));
http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/tests/functions/BinaryNumericTest.java
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/tests/functions/BinaryNumericTest.java b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/tests/functions/BinaryNumericTest.java
index d59e5d2..a35781c 100644
--- a/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/tests/functions/BinaryNumericTest.java
+++ b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/tests/functions/BinaryNumericTest.java
@@ -20,7 +20,6 @@ package org.apache.marmotta.ldpath.model.tests.functions;
import java.util.Collection;
-import org.apache.marmotta.ldpath.api.backend.NodeBackend;
import org.apache.marmotta.ldpath.api.backend.RDFBackend;
import org.apache.marmotta.ldpath.api.functions.TestFunction;
import org.apache.marmotta.ldpath.model.transformers.DoubleTransformer;
@@ -31,6 +30,7 @@ public abstract class BinaryNumericTest<Node> extends TestFunction<Node> {
protected final DoubleTransformer<Node> transformer = new DoubleTransformer<Node>();
@Override
+ @SafeVarargs
public final Boolean apply(RDFBackend<Node> backend, Node context,
Collection<Node>... args) throws IllegalArgumentException {
@@ -49,7 +49,7 @@ public abstract class BinaryNumericTest<Node> extends TestFunction<Node> {
return true;
}
- protected boolean test(NodeBackend<Node> backend, Node leftNode, Node rightNode) {
+ protected boolean test(RDFBackend<Node> backend, Node leftNode, Node rightNode) {
try {
return test(transformer.transform(backend, leftNode, null), transformer.transform(backend, rightNode, null));
} catch (IllegalArgumentException e) {
http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/transformers/BigDecimalTransformer.java
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/transformers/BigDecimalTransformer.java b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/transformers/BigDecimalTransformer.java
index d15b185..543ae9b 100644
--- a/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/transformers/BigDecimalTransformer.java
+++ b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/transformers/BigDecimalTransformer.java
@@ -21,7 +21,7 @@ package org.apache.marmotta.ldpath.model.transformers;
import java.math.BigDecimal;
import java.util.Map;
-import org.apache.marmotta.ldpath.api.backend.NodeBackend;
+import org.apache.marmotta.ldpath.api.backend.RDFBackend;
import org.apache.marmotta.ldpath.api.transformers.NodeTransformer;
/**
@@ -32,7 +32,7 @@ import org.apache.marmotta.ldpath.api.transformers.NodeTransformer;
public class BigDecimalTransformer<Node> implements NodeTransformer<BigDecimal,Node> {
@Override
- public BigDecimal transform(NodeBackend<Node> backend, Node node, Map<String, String> configuration) throws IllegalArgumentException {
+ public BigDecimal transform(RDFBackend<Node> backend, Node node, Map<String, String> configuration) throws IllegalArgumentException {
if(backend.isLiteral(node)) {
return backend.decimalValue(node);
} else {
http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/transformers/BigIntegerTransformer.java
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/transformers/BigIntegerTransformer.java b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/transformers/BigIntegerTransformer.java
index 02398a9..f4c95cb 100644
--- a/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/transformers/BigIntegerTransformer.java
+++ b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/transformers/BigIntegerTransformer.java
@@ -20,7 +20,7 @@ package org.apache.marmotta.ldpath.model.transformers;
import java.math.BigInteger;
import java.util.Map;
-import org.apache.marmotta.ldpath.api.backend.NodeBackend;
+import org.apache.marmotta.ldpath.api.backend.RDFBackend;
import org.apache.marmotta.ldpath.api.transformers.NodeTransformer;
@@ -32,7 +32,7 @@ import org.apache.marmotta.ldpath.api.transformers.NodeTransformer;
public class BigIntegerTransformer<Node> implements NodeTransformer<BigInteger,Node> {
@Override
- public BigInteger transform(NodeBackend<Node> backend, Node node, Map<String, String> configuration) throws IllegalArgumentException {
+ public BigInteger transform(RDFBackend<Node> backend, Node node, Map<String, String> configuration) throws IllegalArgumentException {
if(backend.isLiteral(node)) {
return backend.integerValue(node);
} else {
http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/transformers/BooleanTransformer.java
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/transformers/BooleanTransformer.java b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/transformers/BooleanTransformer.java
index bd57ecd..9ac484a 100644
--- a/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/transformers/BooleanTransformer.java
+++ b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/transformers/BooleanTransformer.java
@@ -17,7 +17,7 @@
*/
package org.apache.marmotta.ldpath.model.transformers;
-import org.apache.marmotta.ldpath.api.backend.NodeBackend;
+import org.apache.marmotta.ldpath.api.backend.RDFBackend;
import org.apache.marmotta.ldpath.api.transformers.NodeTransformer;
import java.util.Map;
@@ -35,11 +35,13 @@ public class BooleanTransformer<Node> implements NodeTransformer<Boolean,Node> {
* the respective datatype, throws an IllegalArgumentException that needs to be caught by the class
* carrying out the transformation.
*
+ *
+ * @param rdfBackend
* @param node
* @return
*/
@Override
- public Boolean transform(NodeBackend<Node> rdfBackend, Node node, Map<String, String> configuration) throws IllegalArgumentException {
+ public Boolean transform(RDFBackend<Node> rdfBackend, Node node, Map<String, String> configuration) throws IllegalArgumentException {
if(rdfBackend.isLiteral(node)) {
return rdfBackend.booleanValue(node);
} else {
http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/transformers/ByteTransformer.java
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/transformers/ByteTransformer.java b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/transformers/ByteTransformer.java
index 03f001c..6088f39 100644
--- a/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/transformers/ByteTransformer.java
+++ b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/transformers/ByteTransformer.java
@@ -17,7 +17,7 @@
*/
package org.apache.marmotta.ldpath.model.transformers;
-import org.apache.marmotta.ldpath.api.backend.NodeBackend;
+import org.apache.marmotta.ldpath.api.backend.RDFBackend;
import org.apache.marmotta.ldpath.api.transformers.NodeTransformer;
import java.util.Map;
@@ -25,7 +25,7 @@ import java.util.Map;
public class ByteTransformer<Node> implements NodeTransformer<Byte,Node> {
@Override
- public Byte transform(NodeBackend<Node> backend, Node node, Map<String, String> configuration) throws IllegalArgumentException {
+ public Byte transform(RDFBackend<Node> backend, Node node, Map<String, String> configuration) throws IllegalArgumentException {
if(backend.isLiteral(node)) {
return backend.decimalValue(node).byteValueExact();
} else {
http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/transformers/DateTimeTransformer.java
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/transformers/DateTimeTransformer.java b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/transformers/DateTimeTransformer.java
index 3e6e173..aec6d53 100644
--- a/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/transformers/DateTimeTransformer.java
+++ b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/transformers/DateTimeTransformer.java
@@ -21,7 +21,7 @@ package org.apache.marmotta.ldpath.model.transformers;
import java.util.Date;
import java.util.Map;
-import org.apache.marmotta.ldpath.api.backend.NodeBackend;
+import org.apache.marmotta.ldpath.api.backend.RDFBackend;
import org.apache.marmotta.ldpath.api.transformers.NodeTransformer;
/**
@@ -38,11 +38,13 @@ public class DateTimeTransformer<Node> implements NodeTransformer<Date,Node> {
* the respective datatype, throws an IllegalArgumentException that needs to be caught by the class
* carrying out the transformation.
*
+ *
+ * @param rdfBackend
* @param node
* @return
*/
@Override
- public Date transform(NodeBackend<Node> rdfBackend, Node node, Map<String, String> configuration) throws IllegalArgumentException {
+ public Date transform(RDFBackend<Node> rdfBackend, Node node, Map<String, String> configuration) throws IllegalArgumentException {
if(rdfBackend.isLiteral(node)) {
return rdfBackend.dateTimeValue(node);
} else {
http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/transformers/DateTransformer.java
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/transformers/DateTransformer.java b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/transformers/DateTransformer.java
index c47387a..58937ad 100644
--- a/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/transformers/DateTransformer.java
+++ b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/transformers/DateTransformer.java
@@ -20,7 +20,7 @@ package org.apache.marmotta.ldpath.model.transformers;
import java.util.Date;
import java.util.Map;
-import org.apache.marmotta.ldpath.api.backend.NodeBackend;
+import org.apache.marmotta.ldpath.api.backend.RDFBackend;
import org.apache.marmotta.ldpath.api.transformers.NodeTransformer;
/**
@@ -37,11 +37,13 @@ public class DateTransformer<Node> implements NodeTransformer<Date,Node> {
* the respective datatype, throws an IllegalArgumentException that needs to be caught by the class
* carrying out the transformation.
*
+ *
+ * @param rdfBackend
* @param node
* @return
*/
@Override
- public Date transform(NodeBackend<Node> rdfBackend, Node node, Map<String, String> configuration) throws IllegalArgumentException {
+ public Date transform(RDFBackend<Node> rdfBackend, Node node, Map<String, String> configuration) throws IllegalArgumentException {
if(rdfBackend.isLiteral(node)) {
return rdfBackend.dateValue(node);
} else {
http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/transformers/DoubleTransformer.java
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/transformers/DoubleTransformer.java b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/transformers/DoubleTransformer.java
index 83bec9c..d577a2c 100644
--- a/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/transformers/DoubleTransformer.java
+++ b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/transformers/DoubleTransformer.java
@@ -17,7 +17,7 @@
*/
package org.apache.marmotta.ldpath.model.transformers;
-import org.apache.marmotta.ldpath.api.backend.NodeBackend;
+import org.apache.marmotta.ldpath.api.backend.RDFBackend;
import org.apache.marmotta.ldpath.api.transformers.NodeTransformer;
import java.util.Map;
@@ -34,11 +34,13 @@ public class DoubleTransformer<Node> implements NodeTransformer<Double,Node> {
* the respective datatype, throws an IllegalArgumentException that needs to be caught by the class
* carrying out the transformation.
*
+ *
+ * @param rdfBackend
* @param node
* @return
*/
@Override
- public Double transform(NodeBackend<Node> rdfBackend, Node node, Map<String, String> configuration) throws IllegalArgumentException {
+ public Double transform(RDFBackend<Node> rdfBackend, Node node, Map<String, String> configuration) throws IllegalArgumentException {
if(rdfBackend.isLiteral(node)) {
return rdfBackend.doubleValue(node);
} else {
http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/transformers/DurationTransformer.java
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/transformers/DurationTransformer.java b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/transformers/DurationTransformer.java
index 37d7f54..57a50c6 100644
--- a/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/transformers/DurationTransformer.java
+++ b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/transformers/DurationTransformer.java
@@ -21,7 +21,7 @@ import javax.xml.datatype.DatatypeConfigurationException;
import javax.xml.datatype.DatatypeFactory;
import javax.xml.datatype.Duration;
-import org.apache.marmotta.ldpath.api.backend.NodeBackend;
+import org.apache.marmotta.ldpath.api.backend.RDFBackend;
import org.apache.marmotta.ldpath.api.transformers.NodeTransformer;
import java.util.Map;
@@ -58,7 +58,7 @@ public class DurationTransformer<Node> implements NodeTransformer<Duration,Node>
return xmlDatatypeFactory;
}
@Override
- public Duration transform(NodeBackend<Node> backend, Node node, Map<String, String> configuration) throws IllegalArgumentException {
+ public Duration transform(RDFBackend<Node> backend, Node node, Map<String, String> configuration) throws IllegalArgumentException {
if(backend.isLiteral(node)) {
return toDuration(backend.stringValue(node), false);
} else {
http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/transformers/FloatTransformer.java
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/transformers/FloatTransformer.java b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/transformers/FloatTransformer.java
index f019df3..a853963 100644
--- a/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/transformers/FloatTransformer.java
+++ b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/transformers/FloatTransformer.java
@@ -17,7 +17,7 @@
*/
package org.apache.marmotta.ldpath.model.transformers;
-import org.apache.marmotta.ldpath.api.backend.NodeBackend;
+import org.apache.marmotta.ldpath.api.backend.RDFBackend;
import org.apache.marmotta.ldpath.api.transformers.NodeTransformer;
import java.util.Map;
@@ -36,11 +36,13 @@ public class FloatTransformer<Node> implements NodeTransformer<Float,Node> {
* the respective datatype, throws an IllegalArgumentException that needs to be caught by the class
* carrying out the transformation.
*
+ *
+ * @param rdfBackend
* @param node
* @return
*/
@Override
- public Float transform(NodeBackend<Node> rdfBackend, Node node, Map<String, String> configuration) throws IllegalArgumentException {
+ public Float transform(RDFBackend<Node> rdfBackend, Node node, Map<String, String> configuration) throws IllegalArgumentException {
if(rdfBackend.isLiteral(node)) {
return rdfBackend.floatValue(node);
} else {
http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/transformers/IdentityTransformer.java
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/transformers/IdentityTransformer.java b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/transformers/IdentityTransformer.java
index f0fc6eb..7fc0713 100644
--- a/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/transformers/IdentityTransformer.java
+++ b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/transformers/IdentityTransformer.java
@@ -17,7 +17,7 @@
*/
package org.apache.marmotta.ldpath.model.transformers;
-import org.apache.marmotta.ldpath.api.backend.NodeBackend;
+import org.apache.marmotta.ldpath.api.backend.RDFBackend;
import org.apache.marmotta.ldpath.api.transformers.NodeTransformer;
import java.util.Map;
@@ -35,11 +35,13 @@ public class IdentityTransformer<Node> implements NodeTransformer<Node,Node> {
* the respective datatype, throws an IllegalArgumentException that needs to be caught by the class
* carrying out the transformation.
*
+ *
+ * @param nodeRDFBackend
* @param node
* @return
*/
@Override
- public Node transform(NodeBackend<Node> nodeRDFBackend, Node node, Map<String, String> configuration) throws IllegalArgumentException {
+ public Node transform(RDFBackend<Node> nodeRDFBackend, Node node, Map<String, String> configuration) throws IllegalArgumentException {
return node;
}
}
http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/transformers/IntTransformer.java
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/transformers/IntTransformer.java b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/transformers/IntTransformer.java
index d0a33c9..8cddda4 100644
--- a/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/transformers/IntTransformer.java
+++ b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/transformers/IntTransformer.java
@@ -17,7 +17,7 @@
*/
package org.apache.marmotta.ldpath.model.transformers;
-import org.apache.marmotta.ldpath.api.backend.NodeBackend;
+import org.apache.marmotta.ldpath.api.backend.RDFBackend;
import org.apache.marmotta.ldpath.api.transformers.NodeTransformer;
import java.util.Map;
@@ -35,11 +35,13 @@ public class IntTransformer<Node> implements NodeTransformer<Integer,Node> {
* the respective datatype, throws an IllegalArgumentException that needs to be caught by the class
* carrying out the transformation.
*
+ *
+ * @param rdfBackend
* @param node
* @return
*/
@Override
- public Integer transform(NodeBackend<Node> rdfBackend, Node node, Map<String, String> configuration) throws IllegalArgumentException {
+ public Integer transform(RDFBackend<Node> rdfBackend, Node node, Map<String, String> configuration) throws IllegalArgumentException {
if(rdfBackend.isLiteral(node)) {
return rdfBackend.intValue(node);
} else {
http://git-wip-us.apache.org/repos/asf/marmotta/blob/582abb5b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/transformers/LongTransformer.java
----------------------------------------------------------------------
diff --git a/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/transformers/LongTransformer.java b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/transformers/LongTransformer.java
index 4188e02..49754e5 100644
--- a/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/transformers/LongTransformer.java
+++ b/libraries/ldpath/ldpath-core/src/main/java/org/apache/marmotta/ldpath/model/transformers/LongTransformer.java
@@ -17,7 +17,7 @@
*/
package org.apache.marmotta.ldpath.model.transformers;
-import org.apache.marmotta.ldpath.api.backend.NodeBackend;
+import org.apache.marmotta.ldpath.api.backend.RDFBackend;
import org.apache.marmotta.ldpath.api.transformers.NodeTransformer;
import java.util.Map;
@@ -34,11 +34,13 @@ public class LongTransformer<Node> implements NodeTransformer<Long,Node> {
* the respective datatype, throws an IllegalArgumentException that needs to be caught by the class
* carrying out the transformation.
*
+ *
+ * @param rdfBackend
* @param node
* @return
*/
@Override
- public Long transform(NodeBackend<Node> rdfBackend, Node node, Map<String, String> configuration) throws IllegalArgumentException {
+ public Long transform(RDFBackend<Node> rdfBackend, Node node, Map<String, String> configuration) throws IllegalArgumentException {
if(rdfBackend.isLiteral(node)) {
return rdfBackend.longValue(node);
} else {