You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stanbol.apache.org by sf...@apache.org on 2010/12/10 12:47:44 UTC
svn commit: r1044310 - in /incubator/stanbol/trunk/fise:
generic/jsonld/src/main/java/eu/iksproject/fise/jsonld/
generic/servicesapi/src/main/java/eu/iksproject/fise/servicesapi/
generic/servicesapi/src/main/java/eu/iksproject/fise/servicesapi/helper/ ...
Author: sfermigier
Date: Fri Dec 10 11:47:43 2010
New Revision: 1044310
URL: http://svn.apache.org/viewvc?rev=1044310&view=rev
Log:
Cosmetic fixes.
Modified:
incubator/stanbol/trunk/fise/generic/jsonld/src/main/java/eu/iksproject/fise/jsonld/JsonComparator.java
incubator/stanbol/trunk/fise/generic/jsonld/src/main/java/eu/iksproject/fise/jsonld/JsonLd.java
incubator/stanbol/trunk/fise/generic/servicesapi/src/main/java/eu/iksproject/fise/servicesapi/ContentItem.java
incubator/stanbol/trunk/fise/generic/servicesapi/src/main/java/eu/iksproject/fise/servicesapi/Enhancement.java
incubator/stanbol/trunk/fise/generic/servicesapi/src/main/java/eu/iksproject/fise/servicesapi/EnhancementEngine.java
incubator/stanbol/trunk/fise/generic/servicesapi/src/main/java/eu/iksproject/fise/servicesapi/EnhancementJobManager.java
incubator/stanbol/trunk/fise/generic/servicesapi/src/main/java/eu/iksproject/fise/servicesapi/ServiceProperties.java
incubator/stanbol/trunk/fise/generic/servicesapi/src/main/java/eu/iksproject/fise/servicesapi/Store.java
incubator/stanbol/trunk/fise/generic/servicesapi/src/main/java/eu/iksproject/fise/servicesapi/helper/ContentItemHelper.java
incubator/stanbol/trunk/fise/generic/servicesapi/src/main/java/eu/iksproject/fise/servicesapi/helper/EnhancementEngineHelper.java
incubator/stanbol/trunk/fise/generic/servicesapi/src/main/java/eu/iksproject/fise/servicesapi/helper/RdfEntity.java
incubator/stanbol/trunk/fise/generic/servicesapi/src/main/java/eu/iksproject/fise/servicesapi/helper/RdfEntityFactory.java
incubator/stanbol/trunk/fise/generic/servicesapi/src/main/java/eu/iksproject/fise/servicesapi/helper/impl/RdfProxyInvocationHandler.java
incubator/stanbol/trunk/fise/generic/servicesapi/src/main/java/eu/iksproject/fise/servicesapi/helper/impl/SimpleRdfEntityFactory.java
incubator/stanbol/trunk/fise/generic/servicesapi/src/main/java/eu/iksproject/fise/servicesapi/package.html
incubator/stanbol/trunk/fise/generic/servicesapi/src/main/java/eu/iksproject/fise/servicesapi/rdf/NamespaceEnum.java
incubator/stanbol/trunk/fise/jersey/src/main/java/eu/iksproject/fise/jersey/cache/EntityCacheProvider.java
incubator/stanbol/trunk/fise/parent/pom.xml
incubator/stanbol/trunk/fise/stores/jcrstore/README.txt
Modified: incubator/stanbol/trunk/fise/generic/jsonld/src/main/java/eu/iksproject/fise/jsonld/JsonComparator.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/fise/generic/jsonld/src/main/java/eu/iksproject/fise/jsonld/JsonComparator.java?rev=1044310&r1=1044309&r2=1044310&view=diff
==============================================================================
--- incubator/stanbol/trunk/fise/generic/jsonld/src/main/java/eu/iksproject/fise/jsonld/JsonComparator.java (original)
+++ incubator/stanbol/trunk/fise/generic/jsonld/src/main/java/eu/iksproject/fise/jsonld/JsonComparator.java Fri Dec 10 11:47:43 2010
@@ -41,6 +41,4 @@ public class JsonComparator implements C
return value;
}
-
-
}
Modified: incubator/stanbol/trunk/fise/generic/jsonld/src/main/java/eu/iksproject/fise/jsonld/JsonLd.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/fise/generic/jsonld/src/main/java/eu/iksproject/fise/jsonld/JsonLd.java?rev=1044310&r1=1044309&r2=1044310&view=diff
==============================================================================
--- incubator/stanbol/trunk/fise/generic/jsonld/src/main/java/eu/iksproject/fise/jsonld/JsonLd.java (original)
+++ incubator/stanbol/trunk/fise/generic/jsonld/src/main/java/eu/iksproject/fise/jsonld/JsonLd.java Fri Dec 10 11:47:43 2010
@@ -78,7 +78,7 @@ public class JsonLd {
private List<Object> createDisjointGraph() {
List<Object> json = new ArrayList<Object>();
- if (this.resourceMap.size() > 0) {
+ if (!this.resourceMap.isEmpty()) {
for (String subject : this.resourceMap.keySet()) {
Map<String, Object> subjectObject = new TreeMap<String, Object>(new JsonComparator());
@@ -117,7 +117,7 @@ public class JsonLd {
@SuppressWarnings("unchecked")
private Map<String, Object> createJointGraph() {
Map<String, Object> json = new TreeMap<String, Object>(new JsonComparator());
- if (this.resourceMap.size() > 0) {
+ if (!this.resourceMap.isEmpty()) {
List<Object> subjects = new ArrayList<Object>();
for (String subject : this.resourceMap.keySet()) {
@@ -142,7 +142,7 @@ public class JsonLd {
}
// put subjects
- if (subjects.size() > 0) {
+ if (!subjects.isEmpty()) {
if (subjects.size() == 1) {
json = (Map<String, Object>) subjects.get(0);
} else {
@@ -152,7 +152,7 @@ public class JsonLd {
}
// put the namespaces
- if (this.namespacePrefixMap.size() > 0) {
+ if (!this.namespacePrefixMap.isEmpty()) {
Map<String, Object> nsObject = new TreeMap<String, Object>(new JsonComparator());
for (String ns : this.namespacePrefixMap.keySet()) {
nsObject.put(this.namespacePrefixMap.get(ns), ns);
@@ -164,7 +164,7 @@ public class JsonLd {
}
private void putTypes(Map<String, Object> subjectObject, JsonLdResource resource) {
- if (resource.getTypes().size() > 0) {
+ if (!resource.getTypes().isEmpty()) {
List<String> types = new ArrayList<String>();
for (String type : resource.getTypes()) {
types.add(this.applyNamespace(type));
Modified: incubator/stanbol/trunk/fise/generic/servicesapi/src/main/java/eu/iksproject/fise/servicesapi/ContentItem.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/fise/generic/servicesapi/src/main/java/eu/iksproject/fise/servicesapi/ContentItem.java?rev=1044310&r1=1044309&r2=1044310&view=diff
==============================================================================
--- incubator/stanbol/trunk/fise/generic/servicesapi/src/main/java/eu/iksproject/fise/servicesapi/ContentItem.java (original)
+++ incubator/stanbol/trunk/fise/generic/servicesapi/src/main/java/eu/iksproject/fise/servicesapi/ContentItem.java Fri Dec 10 11:47:43 2010
@@ -1,4 +1,4 @@
-/**
+/*
Copyright (c) 2010, IKS Project
All rights reserved.
@@ -43,6 +43,7 @@ import org.apache.clerezza.rdf.core.MGra
* (provided by client and/or generated).
*/
public interface ContentItem {
+
/** Unique ID, either supplied by client or generated by FISE */
String getId();
Modified: incubator/stanbol/trunk/fise/generic/servicesapi/src/main/java/eu/iksproject/fise/servicesapi/Enhancement.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/fise/generic/servicesapi/src/main/java/eu/iksproject/fise/servicesapi/Enhancement.java?rev=1044310&r1=1044309&r2=1044310&view=diff
==============================================================================
--- incubator/stanbol/trunk/fise/generic/servicesapi/src/main/java/eu/iksproject/fise/servicesapi/Enhancement.java (original)
+++ incubator/stanbol/trunk/fise/generic/servicesapi/src/main/java/eu/iksproject/fise/servicesapi/Enhancement.java Fri Dec 10 11:47:43 2010
@@ -1,19 +1,16 @@
package eu.iksproject.fise.servicesapi;
-import java.net.URI;
import java.util.Collection;
import java.util.Date;
-import org.apache.clerezza.rdf.core.MGraph;
import org.apache.clerezza.rdf.core.UriRef;
-import org.apache.clerezza.rdf.core.impl.SimpleMGraph;
import eu.iksproject.fise.servicesapi.helper.Rdf;
import eu.iksproject.fise.servicesapi.helper.RdfEntity;
-import eu.iksproject.fise.servicesapi.helper.RdfEntityFactory;
/**
* This Interface represents a Fise enhancement.
+ *
* To create an instance of this interface use the following code
* <code><pre>
* ContentItem ci;
@@ -26,8 +23,8 @@ import eu.iksproject.fise.servicesapi.he
* enhancement.setCreated(new Date());
* ...
* </pre></code>
- * @author Rupert Westenthaler
*
+ * @author Rupert Westenthaler
*/
@Rdf(id="http://fise.iks-project.eu/ontology/Enhancement")
public interface Enhancement extends RdfEntity{
Modified: incubator/stanbol/trunk/fise/generic/servicesapi/src/main/java/eu/iksproject/fise/servicesapi/EnhancementEngine.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/fise/generic/servicesapi/src/main/java/eu/iksproject/fise/servicesapi/EnhancementEngine.java?rev=1044310&r1=1044309&r2=1044310&view=diff
==============================================================================
--- incubator/stanbol/trunk/fise/generic/servicesapi/src/main/java/eu/iksproject/fise/servicesapi/EnhancementEngine.java (original)
+++ incubator/stanbol/trunk/fise/generic/servicesapi/src/main/java/eu/iksproject/fise/servicesapi/EnhancementEngine.java Fri Dec 10 11:47:43 2010
@@ -1,4 +1,4 @@
-/**
+/*
Copyright (c) 2010, IKS Project
All rights reserved.
Modified: incubator/stanbol/trunk/fise/generic/servicesapi/src/main/java/eu/iksproject/fise/servicesapi/EnhancementJobManager.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/fise/generic/servicesapi/src/main/java/eu/iksproject/fise/servicesapi/EnhancementJobManager.java?rev=1044310&r1=1044309&r2=1044310&view=diff
==============================================================================
--- incubator/stanbol/trunk/fise/generic/servicesapi/src/main/java/eu/iksproject/fise/servicesapi/EnhancementJobManager.java (original)
+++ incubator/stanbol/trunk/fise/generic/servicesapi/src/main/java/eu/iksproject/fise/servicesapi/EnhancementJobManager.java Fri Dec 10 11:47:43 2010
@@ -1,4 +1,4 @@
-/**
+/*
Copyright (c) 2010, IKS Project
All rights reserved.
@@ -38,17 +38,18 @@ import java.util.List;
* Accept requests for enhancing ContentItems, and processes them either
* synchronously or asynchronously (as decided by the enhancement engines or by
* configuration).
- *
+ * <p>
* The progress of the enhancement process should be made accessible in the
* ContentItem's metadata.
*/
public interface EnhancementJobManager {
+
/**
* Create relevant asynchronous requests or enhance content immediately. The
* result is not persisted right now. The caller is responsible to call the
* {@link Store#put(ContentItem)} afterwards in case persistence is
* required.
- *
+ * <p>
* TODO: define the expected semantics if asynchronous enhancements were to
* get implemented.
*
Modified: incubator/stanbol/trunk/fise/generic/servicesapi/src/main/java/eu/iksproject/fise/servicesapi/ServiceProperties.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/fise/generic/servicesapi/src/main/java/eu/iksproject/fise/servicesapi/ServiceProperties.java?rev=1044310&r1=1044309&r2=1044310&view=diff
==============================================================================
--- incubator/stanbol/trunk/fise/generic/servicesapi/src/main/java/eu/iksproject/fise/servicesapi/ServiceProperties.java (original)
+++ incubator/stanbol/trunk/fise/generic/servicesapi/src/main/java/eu/iksproject/fise/servicesapi/ServiceProperties.java Fri Dec 10 11:47:43 2010
@@ -4,13 +4,14 @@ import java.util.Map;
/**
* FISE components might implement this interface to parse additional
- * properties to other components
- * @author Rupert Westenthaler
+ * properties to other components.
*
+ * @author Rupert Westenthaler
*/
public interface ServiceProperties {
+
/**
- * Getter for the properties defined by this service
+ * Getter for the properties defined by this service.
* @return An unmodifiable map of properties defined by this service
*/
Map<String,Object> getServiceProperties();
@@ -28,12 +29,14 @@ public interface ServiceProperties {
* dose some pre processing on the content
*/
Integer ORDERING_PRE_PROCESSING = 200;
+
/**
* Ordering values < {@link ServiceProperties#ORDERING_PRE_PROCESSING} and
* >= this value indicate, that an enhancement engine performs operations
* that are only dependent on the parsed content.
*/
Integer ORDERING_CONTENT_EXTRACTION = 100;
+
/**
* Ordering values < {@link ServiceProperties#ORDERING_CONTENT_EXTRACTION}
* and >= this value indicate, that an enhancement engine performs operations
@@ -42,6 +45,7 @@ public interface ServiceProperties {
* available to other engines using this ordering range
*/
Integer ORDERING_EXTRACTION_ENHANCEMENT = 1;
+
/**
* The default ordering uses {@link ServiceProperties#ORDERING_EXTRACTION_ENHANCEMENT}
* -1 . So by default EnhancementEngines are called after all engines that
@@ -49,10 +53,12 @@ public interface ServiceProperties {
* {@link ServiceProperties#ORDERING_EXTRACTION_ENHANCEMENT}
*/
Integer ORDERING_DEFAULT = 0;
+
/**
* Ordering values < {@link ServiceProperties#ORDERING_DEFAULT} and >= this
* value indicate that an enhancement engine performs post processing
* operations on existing enhancements.
*/
Integer ORDERING_POST_PROCESSING = -100;
+
}
Modified: incubator/stanbol/trunk/fise/generic/servicesapi/src/main/java/eu/iksproject/fise/servicesapi/Store.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/fise/generic/servicesapi/src/main/java/eu/iksproject/fise/servicesapi/Store.java?rev=1044310&r1=1044309&r2=1044310&view=diff
==============================================================================
--- incubator/stanbol/trunk/fise/generic/servicesapi/src/main/java/eu/iksproject/fise/servicesapi/Store.java (original)
+++ incubator/stanbol/trunk/fise/generic/servicesapi/src/main/java/eu/iksproject/fise/servicesapi/Store.java Fri Dec 10 11:47:43 2010
@@ -1,4 +1,4 @@
-/**
+/*
Copyright (c) 2010, IKS Project
All rights reserved.
Modified: incubator/stanbol/trunk/fise/generic/servicesapi/src/main/java/eu/iksproject/fise/servicesapi/helper/ContentItemHelper.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/fise/generic/servicesapi/src/main/java/eu/iksproject/fise/servicesapi/helper/ContentItemHelper.java?rev=1044310&r1=1044309&r2=1044310&view=diff
==============================================================================
--- incubator/stanbol/trunk/fise/generic/servicesapi/src/main/java/eu/iksproject/fise/servicesapi/helper/ContentItemHelper.java (original)
+++ incubator/stanbol/trunk/fise/generic/servicesapi/src/main/java/eu/iksproject/fise/servicesapi/helper/ContentItemHelper.java Fri Dec 10 11:47:43 2010
@@ -120,7 +120,7 @@ public class ContentItemHelper {
// calculate an ID based on the digest of the content
String hexDigest = "";
if (!baseUri.startsWith("urn:") && !baseUri.endsWith("/")) {
- baseUri = baseUri + "/";
+ baseUri += "/";
}
try {
hexDigest = ContentItemHelper.streamDigest(
Modified: incubator/stanbol/trunk/fise/generic/servicesapi/src/main/java/eu/iksproject/fise/servicesapi/helper/EnhancementEngineHelper.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/fise/generic/servicesapi/src/main/java/eu/iksproject/fise/servicesapi/helper/EnhancementEngineHelper.java?rev=1044310&r1=1044309&r2=1044310&view=diff
==============================================================================
--- incubator/stanbol/trunk/fise/generic/servicesapi/src/main/java/eu/iksproject/fise/servicesapi/helper/EnhancementEngineHelper.java (original)
+++ incubator/stanbol/trunk/fise/generic/servicesapi/src/main/java/eu/iksproject/fise/servicesapi/helper/EnhancementEngineHelper.java Fri Dec 10 11:47:43 2010
@@ -35,10 +35,11 @@ public class EnhancementEngineHelper {
* Create a new instance with the types fise:Enhancement and
* fise:TextAnnotation in the metadata-graph of the content
* item along with default properties (dc:creator and dc:created) and return
- * the UriRef of the extraction so that engines can further add
+ * the UriRef of the extraction so that engines can further add.
*
* @param ci the ContentItem being under analysis
* @param engine the Engine performing the analysis
+ *
* @return the URI of the new enhancement instance
*/
public static UriRef createTextEnhancement(ContentItem ci,
@@ -49,10 +50,12 @@ public class EnhancementEngineHelper {
* Create a new instance with the types fise:Enhancement and
* fise:TextAnnotation in the parsed graph along with default properties
* (dc:creator, dc:created and fise:extracted-form) and return
- * the UriRef of the extraction so that engines can further add
+ * the UriRef of the extraction so that engines can further add.
+ *
* @param metadata the graph
* @param engine the engine
* @param contentItemId the id
+ *
* @return the URI of the new enhancement instance
*/
public static UriRef createTextEnhancement(MGraph metadata,
@@ -81,10 +84,12 @@ public class EnhancementEngineHelper {
* Create a new instance with the types fise:Enhancement and
* fise:EntityAnnotation in the parsed graph along with default properties
* (dc:creator, dc:created and fise:extracted-form) and return
- * the UriRef of the extraction so that engines can further add
+ * the UriRef of the extraction so that engines can further add.
+ *
* @param metadata the graph
* @param engine the engine
* @param contentItemId the id
+ *
* @return the URI of the new enhancement instance
*/
public static UriRef createEntityEnhancement(MGraph metadata,
@@ -97,10 +102,11 @@ public class EnhancementEngineHelper {
/**
* Create a new enhancement instance in the metadata-graph of the content
* item along with default properties (dc:creator and dc:created) and return
- * the UriRef of the extraction so that engines can further add
+ * the UriRef of the extraction so that engines can further add.
*
* @param ci the ContentItem being under analysis
* @param engine the Engine performing the analysis
+ *
* @return the URI of the new enhancement instance
*/
protected static UriRef createEnhancement(MGraph metadata,
@@ -184,8 +190,10 @@ public class EnhancementEngineHelper {
public static UUID randomUUID() {
return new UUID(rng.nextLong(), rng.nextLong());
}
+
/**
- * Getter for the first typed literal value of the property for a resource
+ * Getter for the first typed literal value of the property for a resource.
+ *
* @param <T> the java class the literal value needs to be converted to.
* Note that the parsed LiteralFactory needs to support this conversion
* @param graph the graph used to query for the property value
Modified: incubator/stanbol/trunk/fise/generic/servicesapi/src/main/java/eu/iksproject/fise/servicesapi/helper/RdfEntity.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/fise/generic/servicesapi/src/main/java/eu/iksproject/fise/servicesapi/helper/RdfEntity.java?rev=1044310&r1=1044309&r2=1044310&view=diff
==============================================================================
--- incubator/stanbol/trunk/fise/generic/servicesapi/src/main/java/eu/iksproject/fise/servicesapi/helper/RdfEntity.java (original)
+++ incubator/stanbol/trunk/fise/generic/servicesapi/src/main/java/eu/iksproject/fise/servicesapi/helper/RdfEntity.java Fri Dec 10 11:47:43 2010
@@ -7,12 +7,14 @@ import org.apache.clerezza.rdf.core.UriR
/**
* Super interface for all interfaces using the {@link RdfEntityFactory} to
* create proxy objects.
- * @author Rupert Westenthaler
*
+ * @author Rupert Westenthaler
*/
public interface RdfEntity {
+
/**
- * Getter for the RDF node represented by the proxy
+ * Getter for the RDF node represented by the proxy.
+ *
* @return the node representing the proxy. Typically an {@link UriRef} but
* could be also a {@link BNode}
*/
Modified: incubator/stanbol/trunk/fise/generic/servicesapi/src/main/java/eu/iksproject/fise/servicesapi/helper/RdfEntityFactory.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/fise/generic/servicesapi/src/main/java/eu/iksproject/fise/servicesapi/helper/RdfEntityFactory.java?rev=1044310&r1=1044309&r2=1044310&view=diff
==============================================================================
--- incubator/stanbol/trunk/fise/generic/servicesapi/src/main/java/eu/iksproject/fise/servicesapi/helper/RdfEntityFactory.java (original)
+++ incubator/stanbol/trunk/fise/generic/servicesapi/src/main/java/eu/iksproject/fise/servicesapi/helper/RdfEntityFactory.java Fri Dec 10 11:47:43 2010
@@ -8,9 +8,9 @@ import org.apache.clerezza.rdf.core.NonL
import eu.iksproject.fise.servicesapi.helper.impl.SimpleRdfEntityFactory;
/**
- * A Factory that creates proxies over rdf nodes.
- * @author Rupert Westenthaler
+ * A Factory that creates proxies over rdf nodes.
*
+ * @author Rupert Westenthaler
*/
public abstract class RdfEntityFactory {
@@ -23,10 +23,12 @@ public abstract class RdfEntityFactory {
public static RdfEntityFactory createInstance(MGraph graph){
return new SimpleRdfEntityFactory(graph);
}
+
/**
* Getter for a proxy for the parsed rdf node that implements all the parsed
* Interfaces. The interface parsed as type must extend {@link RdfEntity}.
- * Additional interfaces must not extend this interface.<p>
+ * Additional interfaces must not extend this interface.
+ * <p>
* Interfaces parsed as parameter:<ul>
* <li> SHOULD have an {@link Rdf} annotation. If that is the case, than the
* according rdf:type statements are checks/added when the proxy is created
@@ -48,12 +50,14 @@ public abstract class RdfEntityFactory {
* {@link ConcurrentModificationException} if the graph changes while using
* the iterator.
* </ul>
+ *
* @param <T> The interface implemented by the returned proxy
* @param rdfNode the rdfNode represented by the proxy (created if not
* present in the Graph)
* @param type The interface for the proxy. Needs to extend {@link RdfEntity}
* @param additionalInterfaces Additional interfaces the proxy needs to
* implement.
+ *
* @return A proxy representing the parsed rdf node and implementing all the
* parsed interfaces
* @throws IllegalArgumentException if the node is <code>null</code> or the
Modified: incubator/stanbol/trunk/fise/generic/servicesapi/src/main/java/eu/iksproject/fise/servicesapi/helper/impl/RdfProxyInvocationHandler.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/fise/generic/servicesapi/src/main/java/eu/iksproject/fise/servicesapi/helper/impl/RdfProxyInvocationHandler.java?rev=1044310&r1=1044309&r2=1044310&view=diff
==============================================================================
--- incubator/stanbol/trunk/fise/generic/servicesapi/src/main/java/eu/iksproject/fise/servicesapi/helper/impl/RdfProxyInvocationHandler.java (original)
+++ incubator/stanbol/trunk/fise/generic/servicesapi/src/main/java/eu/iksproject/fise/servicesapi/helper/impl/RdfProxyInvocationHandler.java Fri Dec 10 11:47:43 2010
@@ -12,7 +12,6 @@ import java.net.URI;
import java.net.URISyntaxException;
import java.net.URL;
import java.util.AbstractCollection;
-import java.util.Arrays;
import java.util.Collection;
import java.util.Collections;
import java.util.HashSet;
@@ -49,6 +48,7 @@ public class RdfProxyInvocationHandler i
* The hashCode Method of {@link Object}
*/
protected final static Method hashCode;
+
static {
try {
getIDMethod = RdfEntity.class.getMethod("getId", new Class<?>[]{});
@@ -61,6 +61,7 @@ public class RdfProxyInvocationHandler i
throw new IllegalStateException("Unable to find getId Method in the "+RdfEntity.class+" Interface",e);
}
}
+
/**
* The logger TODO: Question: How to get the dependencies for logging working with maven :(
*/
@@ -114,7 +115,8 @@ public class RdfProxyInvocationHandler i
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
//RdfEntity rdfEntity;
if(!(proxy instanceof RdfEntity)){
- throw new IllegalArgumentException("Parsed proxy instance is not of type "+RdfEntity.class+". This RdfWrapperInvocationHandler implementations only work for proxis implementing this interface!");
+ throw new IllegalArgumentException("Parsed proxy instance is not of type "+RdfEntity.class
+ +". This RdfWrapperInvocationHandler implementations only work for proxies implementing this interface!");
}
//First check for Methods defined in RDFEntity and java.lang.Object
//implementation of the RffEntity Interface method!
@@ -149,15 +151,18 @@ public class RdfProxyInvocationHandler i
//check the parameter types to improve error messages!
//Only methods with a single parameter are supported
if(parameterTypes.length!=1){
- throw new IllegalStateException("Unsupported parameters for Method "+method.toString()+"! Only setter methodes with a singe parameter are supported.");
+ throw new IllegalStateException("Unsupported parameters for Method "+method.toString()
+ +"! Only setter methodes with a singe parameter are supported.");
}
final Type parameterType = parameterTypes[0];
//now check if args != null and has an element
if(args == null){
- throw new IllegalArgumentException("NULL parsed as \"Object[] args\". An array with a single value is expected when calling "+method.toString()+"!");
+ throw new IllegalArgumentException(
+ "NULL parsed as \"Object[] args\". An array with a single value is expected when calling "+method.toString()+"!");
}
if(args.length<1){
- throw new IllegalArgumentException("An empty array was parsed as \"Object[] args\". An array with a single value is expected when calling method "+method.toString()+"!");
+ throw new IllegalArgumentException(
+ "An empty array was parsed as \"Object[] args\". An array with a single value is expected when calling method "+method.toString()+"!");
}
final Object value = args[0];
//Handle Arrays
@@ -178,7 +183,9 @@ public class RdfProxyInvocationHandler i
genericType = typeArgument;
} else {
//TODO: replace with a warning but for testing start with an exception
- throw new IllegalStateException("Multiple generic type definition for method "+method.toString()+" (generic types: "+((ParameterizedType)parameterTypes[0]).getActualTypeArguments()+")");
+ throw new IllegalStateException(
+ "Multiple generic type definition for method "+method.toString()
+ +" (generic types: "+((ParameterizedType)parameterTypes[0]).getActualTypeArguments()+")");
}
}
}
@@ -200,12 +207,16 @@ public class RdfProxyInvocationHandler i
genericType = typeArgument;
} else {
//TODO: replace with a warning but for testing start with an exception
- throw new IllegalStateException("Multiple generic type definition for method "+method.toString()+" (generic types: "+type.getActualTypeArguments()+")");
+ throw new IllegalStateException(
+ "Multiple generic type definition for method "+method.toString()
+ +" (generic types: "+type.getActualTypeArguments()+")");
}
}
}
if(genericType == null){
- throw new IllegalStateException("Generic Type not defined for Collection in Method "+method.toString()+" (generic type is needed to correctly map rdf values for property "+property);
+ throw new IllegalStateException(
+ "Generic Type not defined for Collection in Method "+method.toString()
+ +" (generic type is needed to correctly map rdf values for property "+property);
}
return getValues(property, (Class<?>)genericType);
} else {
@@ -230,19 +241,27 @@ public class RdfProxyInvocationHandler i
try {
return (T)new URI(((UriRef)result).getUnicodeString());
} catch (URISyntaxException e) {
- throw new IllegalStateException("Unable to parse "+URI.class+" for "+UriRef.class+" value="+((UriRef)result).getUnicodeString());
+ throw new IllegalStateException("Unable to parse "+URI.class
+ +" for "+UriRef.class+" value="+((UriRef)result).getUnicodeString());
}
} else if(URL.class.isAssignableFrom(type)){
try {
return (T)new URL(((UriRef)result).getUnicodeString());
} catch (MalformedURLException e) {
- throw new IllegalStateException("Unable to parse "+URL.class+" for "+UriRef.class+" value="+((UriRef)result).getUnicodeString());
+ throw new IllegalStateException("Unable to parse "+URL.class
+ +" for "+UriRef.class+" value="+((UriRef)result).getUnicodeString());
}
} else {
- throw new IllegalArgumentException("Parsed Type "+type+" is not compatible for result type "+result.getClass()+" (value "+result+") of node "+rdfNode+" and property "+property+"! (Subclass of RdfEntity, UriRef, URI or URL is expected for NonLiteral Values)");
+ throw new IllegalArgumentException("Parsed Type "+type
+ +" is not compatible for result type "+result.getClass()
+ +" (value "+result+") of node "+rdfNode+" and property "+property
+ +"! (Subclass of RdfEntity, UriRef, URI or URL is expected for NonLiteral Values)");
}
} else {
- throw new IllegalArgumentException("Parsed Type "+type+" is not compatible for result type "+result.getClass()+" (value "+result+") of node "+rdfNode+" and property "+property+"! (Subclass of RdfEntity expected as type for NonLiteral values that are no instanceof UriRef)");
+ throw new IllegalArgumentException("Parsed Type "+type
+ +" is not compatible for result type "+result.getClass()
+ +" (value "+result+") of node "+rdfNode+" and property "+property
+ +"! (Subclass of RdfEntity expected as type for NonLiteral values that are no instanceof UriRef)");
}
}
} else {
@@ -286,7 +305,8 @@ public class RdfProxyInvocationHandler i
rdfValue = getRdfResource(value);
return factory.getGraph().add(new TripleImpl(rdfNode, property, rdfValue));
} catch (NoConvertorException e){
- throw new IllegalArgumentException("Unable to transform "+value.getClass()+" to an RDF Node. Only "+RdfEntity.class+" and RDF Literal Types are supported");
+ throw new IllegalArgumentException("Unable to transform "+value.getClass()
+ +" to an RDF Node. Only "+RdfEntity.class+" and RDF Literal Types are supported");
}
}
private boolean removeValue(UriRef property, Object value){
@@ -295,7 +315,8 @@ public class RdfProxyInvocationHandler i
rdfValue = getRdfResource(value);
return factory.getGraph().remove(new TripleImpl(rdfNode, property, rdfValue));
} catch (NoConvertorException e){
- throw new IllegalArgumentException("Unable to transform "+value.getClass()+" to an RDF Node. Only "+RdfEntity.class+" and RDF Literal Types are supported");
+ throw new IllegalArgumentException("Unable to transform "+value.getClass()
+ +" to an RDF Node. Only "+RdfEntity.class+" and RDF Literal Types are supported");
}
}
private void removeValues(UriRef proptery){
@@ -316,7 +337,7 @@ public class RdfProxyInvocationHandler i
*
* @param <T>
*/
- private class RdfProxyPropertyCollection<T> extends java.util.AbstractCollection<T> implements Collection<T>{
+ private class RdfProxyPropertyCollection<T> extends AbstractCollection<T> implements Collection<T>{
//private final NonLiteral resource;
private final UriRef property;
Modified: incubator/stanbol/trunk/fise/generic/servicesapi/src/main/java/eu/iksproject/fise/servicesapi/helper/impl/SimpleRdfEntityFactory.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/fise/generic/servicesapi/src/main/java/eu/iksproject/fise/servicesapi/helper/impl/SimpleRdfEntityFactory.java?rev=1044310&r1=1044309&r2=1044310&view=diff
==============================================================================
--- incubator/stanbol/trunk/fise/generic/servicesapi/src/main/java/eu/iksproject/fise/servicesapi/helper/impl/SimpleRdfEntityFactory.java (original)
+++ incubator/stanbol/trunk/fise/generic/servicesapi/src/main/java/eu/iksproject/fise/servicesapi/helper/impl/SimpleRdfEntityFactory.java Fri Dec 10 11:47:43 2010
@@ -21,9 +21,6 @@ public class SimpleRdfEntityFactory exte
this.literalFactory = LiteralFactory.getInstance();
}
- /* (non-Javadoc)
- * @see eu.iksproject.fise.servicesapi.helper.RdfEntityFactory#getWrapper(org.apache.clerezza.rdf.core.NonLiteral, java.lang.Class, java.lang.Class)
- */
@SuppressWarnings("unchecked")
public <T extends RdfEntity> T getProxy(NonLiteral rdfNode, Class<T> type,Class<?>...additionalInterfaces) {
Class<?>[] interfaces = new Class<?>[additionalInterfaces.length+1];
@@ -33,8 +30,7 @@ public class SimpleRdfEntityFactory exte
Object instance = Proxy.newProxyInstance(SimpleRdfEntityFactory.class.getClassLoader(), interfaces, new RdfProxyInvocationHandler(this, rdfNode, interfaces, literalFactory));
return (T)instance;
}
-
-
+
protected MGraph getGraph() {
return graph;
}
Modified: incubator/stanbol/trunk/fise/generic/servicesapi/src/main/java/eu/iksproject/fise/servicesapi/package.html
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/fise/generic/servicesapi/src/main/java/eu/iksproject/fise/servicesapi/package.html?rev=1044310&r1=1044309&r2=1044310&view=diff
==============================================================================
--- incubator/stanbol/trunk/fise/generic/servicesapi/src/main/java/eu/iksproject/fise/servicesapi/package.html (original)
+++ incubator/stanbol/trunk/fise/generic/servicesapi/src/main/java/eu/iksproject/fise/servicesapi/package.html Fri Dec 10 11:47:43 2010
@@ -37,6 +37,8 @@ as an OSGi service in an OSGi bundle. Se
for an example that wraps a non-OSGi java content enhancement library.
</li>
</ul>
+
+<p>
TODO should we say "annotation" instead of "enhancement", and rename the interfaces
accordingly?
</p>
Modified: incubator/stanbol/trunk/fise/generic/servicesapi/src/main/java/eu/iksproject/fise/servicesapi/rdf/NamespaceEnum.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/fise/generic/servicesapi/src/main/java/eu/iksproject/fise/servicesapi/rdf/NamespaceEnum.java?rev=1044310&r1=1044309&r2=1044310&view=diff
==============================================================================
--- incubator/stanbol/trunk/fise/generic/servicesapi/src/main/java/eu/iksproject/fise/servicesapi/rdf/NamespaceEnum.java (original)
+++ incubator/stanbol/trunk/fise/generic/servicesapi/src/main/java/eu/iksproject/fise/servicesapi/rdf/NamespaceEnum.java Fri Dec 10 11:47:43 2010
@@ -1,38 +1,47 @@
package eu.iksproject.fise.servicesapi.rdf;
public enum NamespaceEnum {
- fise("http://fise.iks-project.eu/ontology/"),
- dbpedia_ont("dbpedia-ont","http://dbpedia.org/ontology/"),
- rdf("http://www.w3.org/1999/02/22-rdf-syntax-ns#"),
- rdfs("http://www.w3.org/2000/01/rdf-schema#"),
- dc("http://purl.org/dc/terms/"),
- skos("http://www.w3.org/2004/02/skos/core#"),
- foaf("http://xmlns.com/foaf/0.1/"),
- geonames("http://www.geonames.org/ontology#"),
- georss("http://www.georss.org/georss/"),
- geo("http://www.w3.org/2003/01/geo/wgs84_pos#"),
- nie("http://www.semanticdesktop.org/ontologies/2007/01/19/nie#");
- String ns;
- String prefix;
- private NamespaceEnum(String ns) {
- if(ns == null){
- throw new IllegalArgumentException("The namespace MUST NOT be NULL");
- }
- this.ns = ns;
- }
- private NamespaceEnum(String prefix,String ns) {
- this(ns);
- this.prefix = prefix;
- }
- public String getNamespace(){
- return ns;
- }
- public String getPrefix(){
- return prefix == null ? name() : prefix;
- }
- @Override
- public String toString() {
- // TODO Auto-generated method stub
- return ns;
- }
+
+ // TODO: use capital for constants instead of lower-case
+ fise("http://fise.iks-project.eu/ontology/"),
+ dbpedia_ont("dbpedia-ont", "http://dbpedia.org/ontology/"),
+ rdf("http://www.w3.org/1999/02/22-rdf-syntax-ns#"),
+ rdfs("http://www.w3.org/2000/01/rdf-schema#"),
+ dc("http://purl.org/dc/terms/"),
+ skos("http://www.w3.org/2004/02/skos/core#"),
+ foaf("http://xmlns.com/foaf/0.1/"),
+ geonames("http://www.geonames.org/ontology#"),
+ georss("http://www.georss.org/georss/"),
+ geo("http://www.w3.org/2003/01/geo/wgs84_pos#"),
+ nie("http://www.semanticdesktop.org/ontologies/2007/01/19/nie#");
+
+ String ns;
+ String prefix;
+
+ NamespaceEnum(String ns) {
+ if (ns == null) {
+ throw new IllegalArgumentException("The namespace MUST NOT be NULL");
+ }
+ this.ns = ns;
+ }
+
+ NamespaceEnum(String prefix, String ns) {
+ this(ns);
+ this.prefix = prefix;
+ }
+
+ public String getNamespace() {
+ return ns;
+ }
+
+ public String getPrefix() {
+ return prefix == null ? name() : prefix;
+ }
+
+ @Override
+ public String toString() {
+ // TODO Auto-generated method stub
+ return ns;
+ }
+
}
Modified: incubator/stanbol/trunk/fise/jersey/src/main/java/eu/iksproject/fise/jersey/cache/EntityCacheProvider.java
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/fise/jersey/src/main/java/eu/iksproject/fise/jersey/cache/EntityCacheProvider.java?rev=1044310&r1=1044309&r2=1044310&view=diff
==============================================================================
--- incubator/stanbol/trunk/fise/jersey/src/main/java/eu/iksproject/fise/jersey/cache/EntityCacheProvider.java (original)
+++ incubator/stanbol/trunk/fise/jersey/src/main/java/eu/iksproject/fise/jersey/cache/EntityCacheProvider.java Fri Dec 10 11:47:43 2010
@@ -4,5 +4,6 @@ import org.apache.clerezza.rdf.core.MGra
public interface EntityCacheProvider {
- public MGraph getEntityCache();
+ MGraph getEntityCache();
+
}
Modified: incubator/stanbol/trunk/fise/parent/pom.xml
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/fise/parent/pom.xml?rev=1044310&r1=1044309&r2=1044310&view=diff
==============================================================================
--- incubator/stanbol/trunk/fise/parent/pom.xml (original)
+++ incubator/stanbol/trunk/fise/parent/pom.xml Fri Dec 10 11:47:43 2010
@@ -21,7 +21,7 @@
<name>IKS FISE Parent POM</name>
<description>
Parent POM for the FISE project
- </description>
+ </description>
<inceptionYear>2010</inceptionYear>
@@ -53,7 +53,6 @@
</goals>
<configuration>
<rules>
- <requirePluginVersions />
<requireJavaVersion>
<message>Java 6 or higher is required to compile this module</message>
<version>1.6</version>
Modified: incubator/stanbol/trunk/fise/stores/jcrstore/README.txt
URL: http://svn.apache.org/viewvc/incubator/stanbol/trunk/fise/stores/jcrstore/README.txt?rev=1044310&r1=1044309&r2=1044310&view=diff
==============================================================================
--- incubator/stanbol/trunk/fise/stores/jcrstore/README.txt (original)
+++ incubator/stanbol/trunk/fise/stores/jcrstore/README.txt Fri Dec 10 11:47:43 2010
@@ -8,8 +8,10 @@ one, so for now SPARQL queries are not s
How to deploy
=============
-You need to have the following bundles deployed in your OSGi runtim.
+You need to have the following bundles deployed in your OSGi runtime.
+
In the future they will be put in the pom.xml, but ATM this is not working, yet:
+
These bundles are also available at http://dl.dropbox.com/u/2022914/fise_jcrstore_bundles.zip
(for your convenience)