Author: rwesten
Date: Mon Dec 16 09:06:20 2013
New Revision: 1551133
URL: http://svn.apache.org/r1551133
Log:
STANBOL-1234: refactored SesameQueryResultList from the SesameYard to an own
module to avoid depending to the whole Yard implementation in the serializer
Added:
stanbol/trunk/entityhub/query/sesame/ (with props)
stanbol/trunk/entityhub/query/sesame/pom.xml
stanbol/trunk/entityhub/query/sesame/src/
stanbol/trunk/entityhub/query/sesame/src/main/
stanbol/trunk/entityhub/query/sesame/src/main/java/
stanbol/trunk/entityhub/query/sesame/src/main/java/org/
stanbol/trunk/entityhub/query/sesame/src/main/java/org/apache/
stanbol/trunk/entityhub/query/sesame/src/main/java/org/apache/stanbol/
stanbol/trunk/entityhub/query/sesame/src/main/java/org/apache/stanbol/entityhub/
stanbol/trunk/entityhub/query/sesame/src/main/java/org/apache/stanbol/entityhub/yard/
stanbol/trunk/entityhub/query/sesame/src/main/java/org/apache/stanbol/entityhub/yard/sesame/
stanbol/trunk/entityhub/query/sesame/src/main/java/org/apache/stanbol/entityhub/yard/sesame/SesameQueryResultList.java
stanbol/trunk/entityhub/query/sesame/src/main/resources/
Removed:
stanbol/trunk/entityhub/yard/sesame/src/main/java/org/apache/stanbol/entityhub/yard/sesame/SesameQueryResultList.java
Modified:
stanbol/trunk/entityhub/yard/sesame/pom.xml
stanbol/trunk/entityhub/yard/sesame/src/main/java/org/apache/stanbol/entityhub/yard/sesame/SesameYard.java
Propchange: stanbol/trunk/entityhub/query/sesame/
------------------------------------------------------------------------------
--- svn:ignore (added)
+++ svn:ignore Mon Dec 16 09:06:20 2013
@@ -0,0 +1,7 @@
+.classpath
+
+.project
+
+target
+
+.settings
Added: stanbol/trunk/entityhub/query/sesame/pom.xml
URL:
http://svn.apache.org/viewvc/stanbol/trunk/entityhub/query/sesame/pom.xml?rev=1551133&view=auto
==============================================================================
--- stanbol/trunk/entityhub/query/sesame/pom.xml (added)
+++ stanbol/trunk/entityhub/query/sesame/pom.xml Mon Dec 16 09:06:20 2013
@@ -0,0 +1,98 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ 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.
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
http://maven.apache.org/maven-v4_0_0.xsd">
+
+ <modelVersion>4.0.0</modelVersion>
+
+ <parent>
+ <groupId>org.apache.stanbol</groupId>
+ <artifactId>apache-stanbol-entityhub</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ <relativePath>../..</relativePath>
+ </parent>
+
+ <artifactId>org.apache.stanbol.entityhub.query.sesame</artifactId>
+ <packaging>bundle</packaging>
+
+ <name>Apache Stanbol Entityhub Query Model for Sesame</name>
+ <description>
+ This bundle provides QueryResultList implementation for Sesame
+ </description>
+
+ <inceptionYear>2013</inceptionYear>
+ <licenses>
+ <license>
+ <name>Apache Software License, Version 2.0</name>
+ <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
+ <distribution>repo</distribution>
+ <comments>A business-friendly OSS license</comments>
+ </license>
+ </licenses>
+
+ <scm>
+ <connection>
+
scm:svn:http://svn.apache.org/repos/asf/stanbol/trunk/entityhub/query/sesame
+ </connection>
+ <developerConnection>
+
scm:svn:https://svn.apache.org/repos/asf/stanbol/trunk/entityhub/query/sesame
+ </developerConnection>
+ <url>http://stanbol.apache.org</url>
+ </scm>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>maven-bundle-plugin</artifactId>
+ <extensions>true</extensions>
+ <configuration>
+ <instructions>
+ <Import-Package>
+ org.apache.stanbol.entityhub.servicesapi.*; provide:=true;
version="[0.11,1.1)",
+ *
+ </Import-Package>
+ <Export-Package>
+
org.apache.stanbol.entityhub.query.sesame;version=${project.version}
+ </Export-Package>
+ </instructions>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>maven-scr-plugin</artifactId>
+ </plugin>
+
+ </plugins>
+ </build>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.stanbol</groupId>
+ <artifactId>org.apache.stanbol.entityhub.model.sesame</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.stanbol</groupId>
+ <artifactId>org.apache.stanbol.entityhub.query.sparql</artifactId>
+ <version>1.0.0-SNAPSHOT</version>
+ </dependency>
+
+ <!-- no tests (tested by the SesameYard tests) -->
+ </dependencies>
+
+</project>
Added:
stanbol/trunk/entityhub/query/sesame/src/main/java/org/apache/stanbol/entityhub/yard/sesame/SesameQueryResultList.java
URL:
http://svn.apache.org/viewvc/stanbol/trunk/entityhub/query/sesame/src/main/java/org/apache/stanbol/entityhub/yard/sesame/SesameQueryResultList.java?rev=1551133&view=auto
==============================================================================
---
stanbol/trunk/entityhub/query/sesame/src/main/java/org/apache/stanbol/entityhub/yard/sesame/SesameQueryResultList.java
(added)
+++
stanbol/trunk/entityhub/query/sesame/src/main/java/org/apache/stanbol/entityhub/yard/sesame/SesameQueryResultList.java
Mon Dec 16 09:06:20 2013
@@ -0,0 +1,96 @@
+/*
+* 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.stanbol.entityhub.yard.sesame;
+
+import java.util.Collection;
+import java.util.Collections;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Set;
+
+import org.apache.stanbol.entityhub.query.sparql.SparqlFieldQuery;
+import org.apache.stanbol.entityhub.servicesapi.model.Representation;
+import org.apache.stanbol.entityhub.servicesapi.query.QueryResultList;
+import org.openrdf.model.Model;
+
+/**
+ * {@link QueryResultList} implementation for Sesame. This provides
+ * access to the Sesame {@link Model} holding the data. Mainly for the use of
+ * Sesame specific RDF serializer.
+ *
+ * @author Rupert Westenthaler
+ *
+ * @param <T>
+ */
+public class SesameQueryResultList implements QueryResultList<Representation> {
+
+ protected final Model model;
+ protected final Collection<Representation> representations;
+ protected final SparqlFieldQuery query;
+
+
+ public SesameQueryResultList(Model model, SparqlFieldQuery query,
List<Representation> representations){
+ this.model = model;
+ this.representations =
Collections.unmodifiableCollection(representations);
+ this.query = query;
+ }
+
+ @Override
+ public SparqlFieldQuery getQuery() {
+ return query;
+ }
+
+ @Override
+ public Set<String> getSelectedFields() {
+ return query.getSelectedFields();
+ }
+
+ @Override
+ public Class<Representation> getType() {
+ return Representation.class;
+ }
+
+ @Override
+ public boolean isEmpty() {
+ return representations.isEmpty();
+
+ }
+
+ @Override
+ public Iterator<Representation> iterator() {
+ return representations.iterator();
+ }
+
+ @Override
+ public Collection<Representation> results() {
+ return representations;
+ }
+
+ @Override
+ public int size() {
+ return representations.size();
+ }
+
+ /**
+ * The model holding all query results
+ * @return
+ */
+ public Model getModel() {
+ return model;
+ }
+
+}
Modified: stanbol/trunk/entityhub/yard/sesame/pom.xml
URL:
http://svn.apache.org/viewvc/stanbol/trunk/entityhub/yard/sesame/pom.xml?rev=1551133&r1=1551132&r2=1551133&view=diff
==============================================================================
--- stanbol/trunk/entityhub/yard/sesame/pom.xml (original)
+++ stanbol/trunk/entityhub/yard/sesame/pom.xml Mon Dec 16 09:06:20 2013
@@ -93,7 +93,7 @@
</dependency>
<dependency>
<groupId>org.apache.stanbol</groupId>
- <artifactId>org.apache.stanbol.entityhub.query.sparql</artifactId>
+ <artifactId>org.apache.stanbol.entityhub.query.sesame</artifactId>
<version>1.0.0-SNAPSHOT</version>
</dependency>
<dependency> <!-- the sesame repository API -->
Modified:
stanbol/trunk/entityhub/yard/sesame/src/main/java/org/apache/stanbol/entityhub/yard/sesame/SesameYard.java
URL:
http://svn.apache.org/viewvc/stanbol/trunk/entityhub/yard/sesame/src/main/java/org/apache/stanbol/entityhub/yard/sesame/SesameYard.java?rev=1551133&r1=1551132&r2=1551133&view=diff
==============================================================================
---
stanbol/trunk/entityhub/yard/sesame/src/main/java/org/apache/stanbol/entityhub/yard/sesame/SesameYard.java
(original)
+++
stanbol/trunk/entityhub/yard/sesame/src/main/java/org/apache/stanbol/entityhub/yard/sesame/SesameYard.java
Mon Dec 16 09:06:20 2013
@@ -16,7 +16,6 @@
*/
package org.apache.stanbol.entityhub.yard.sesame;
-import java.io.Closeable;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.HashSet;