You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stanbol.apache.org by rw...@apache.org on 2012/11/16 15:27:13 UTC
svn commit: r1410361 - in
/stanbol/branches/stanbol-nlp-processing/enhancer/generic: core/
core/src/license/ servicesapi/ servicesapi/src/license/
servicesapi/src/main/java/org/apache/stanbol/enhancer/servicesapi/
servicesapi/src/main/java/org/apache/s...
Author: rwesten
Date: Fri Nov 16 14:27:11 2012
New Revision: 1410361
URL: http://svn.apache.org/viewvc?rev=1410361&view=rev
Log:
STANBOL-733: merged changes from the trunk to the nlp-processing branch
Modified:
stanbol/branches/stanbol-nlp-processing/enhancer/generic/core/ (props changed)
stanbol/branches/stanbol-nlp-processing/enhancer/generic/core/pom.xml
stanbol/branches/stanbol-nlp-processing/enhancer/generic/core/src/license/THIRD-PARTY.properties
stanbol/branches/stanbol-nlp-processing/enhancer/generic/servicesapi/ (props changed)
stanbol/branches/stanbol-nlp-processing/enhancer/generic/servicesapi/pom.xml
stanbol/branches/stanbol-nlp-processing/enhancer/generic/servicesapi/src/license/THIRD-PARTY.properties
stanbol/branches/stanbol-nlp-processing/enhancer/generic/servicesapi/src/main/java/org/apache/stanbol/enhancer/servicesapi/ChainException.java
stanbol/branches/stanbol-nlp-processing/enhancer/generic/servicesapi/src/main/java/org/apache/stanbol/enhancer/servicesapi/ContentItem.java
stanbol/branches/stanbol-nlp-processing/enhancer/generic/servicesapi/src/main/java/org/apache/stanbol/enhancer/servicesapi/ContentItemFactory.java
stanbol/branches/stanbol-nlp-processing/enhancer/generic/servicesapi/src/main/java/org/apache/stanbol/enhancer/servicesapi/helper/EnhancementEngineHelper.java
stanbol/branches/stanbol-nlp-processing/enhancer/generic/servicesapi/src/main/java/org/apache/stanbol/enhancer/servicesapi/helper/ExecutionPlanHelper.java
stanbol/branches/stanbol-nlp-processing/enhancer/generic/servicesapi/src/main/java/org/apache/stanbol/enhancer/servicesapi/impl/AbstractEnhancementEngine.java
stanbol/branches/stanbol-nlp-processing/enhancer/generic/servicesapi/src/main/java/org/apache/stanbol/enhancer/servicesapi/rdf/Properties.java
stanbol/branches/stanbol-nlp-processing/enhancer/generic/servicesapi/src/main/resources/fise.owl
Propchange: stanbol/branches/stanbol-nlp-processing/enhancer/generic/core/
------------------------------------------------------------------------------
--- svn:mergeinfo (added)
+++ svn:mergeinfo Fri Nov 16 14:27:11 2012
@@ -0,0 +1,3 @@
+/incubator/stanbol/branches/dbpedia-spotlight-engines/generic/core:1374978-1386535
+/incubator/stanbol/trunk/enhancer/generic/core:1339554,1339557-1339558,1386989-1388016
+/stanbol/trunk/enhancer/generic/core:1388017-1408755
Modified: stanbol/branches/stanbol-nlp-processing/enhancer/generic/core/pom.xml
URL: http://svn.apache.org/viewvc/stanbol/branches/stanbol-nlp-processing/enhancer/generic/core/pom.xml?rev=1410361&r1=1410360&r2=1410361&view=diff
==============================================================================
--- stanbol/branches/stanbol-nlp-processing/enhancer/generic/core/pom.xml (original)
+++ stanbol/branches/stanbol-nlp-processing/enhancer/generic/core/pom.xml Fri Nov 16 14:27:11 2012
@@ -39,12 +39,12 @@
<scm>
<connection>
- scm:svn:http://svn.apache.org/repos/asf/incubator/stanbol/trunk/enhancer/generic/core/
+ scm:svn:http://svn.apache.org/repos/asf/stanbol/trunk/enhancer/generic/core/
</connection>
<developerConnection>
- scm:svn:https://svn.apache.org/repos/asf/incubator/stanbol/trunk/enhancer/generic/core/
+ scm:svn:https://svn.apache.org/repos/asf/stanbol/trunk/enhancer/generic/core/
</developerConnection>
- <url>http://incubator.apache.org/stanbol/</url>
+ <url>http://stanbol.apache.org/</url>
</scm>
<build>
@@ -55,13 +55,18 @@
<extensions>true</extensions>
<configuration>
<instructions>
+ <Import-Package>
+ org.apache.stanbol.enhancer.servicesapi; provide:=true,
+ org.apache.stanbol.enhancer.servicesapi.impl; provide:=true,
+ *
+ </Import-Package>
<Export-Package>
org.apache.stanbol.enhancer.contentitem.inmemory;version=${project.version},
org.apache.stanbol.enhancer.contentitem.file;version=${project.version}
</Export-Package>
<Private-Package>
- org.apache.stanbol.enhancer.chainmanager.impl;version=${project.version},
- org.apache.stanbol.enhancer.enginemanager.impl;version=${project.version}
+ org.apache.stanbol.enhancer.chainmanager.impl,
+ org.apache.stanbol.enhancer.enginemanager.impl
</Private-Package>
</instructions>
</configuration>
Modified: stanbol/branches/stanbol-nlp-processing/enhancer/generic/core/src/license/THIRD-PARTY.properties
URL: http://svn.apache.org/viewvc/stanbol/branches/stanbol-nlp-processing/enhancer/generic/core/src/license/THIRD-PARTY.properties?rev=1410361&r1=1410360&r2=1410361&view=diff
==============================================================================
--- stanbol/branches/stanbol-nlp-processing/enhancer/generic/core/src/license/THIRD-PARTY.properties (original)
+++ stanbol/branches/stanbol-nlp-processing/enhancer/generic/core/src/license/THIRD-PARTY.properties Fri Nov 16 14:27:11 2012
@@ -18,7 +18,7 @@
# Please fill the missing licenses for dependencies :
#
#
-#Mon Apr 09 10:37:58 CEST 2012
-javax.servlet--servlet-api--2.4=Common Development And Distribution License (CDDL), Version 1.0
+#Sun Oct 07 16:03:50 CEST 2012
+javax.servlet--servlet-api--2.5=Common Development And Distribution License (CDDL), Version 1.0
org.osgi--org.osgi.compendium--4.1.0=Apache Software License, Version 2.0
org.osgi--org.osgi.core--4.1.0=Apache Software License, Version 2.0
Propchange: stanbol/branches/stanbol-nlp-processing/enhancer/generic/servicesapi/
------------------------------------------------------------------------------
--- svn:mergeinfo (added)
+++ svn:mergeinfo Fri Nov 16 14:27:11 2012
@@ -0,0 +1,5 @@
+/incubator/stanbol/branches/dbpedia-spotlight-engines/generic/servicesapi:1374978-1386535
+/incubator/stanbol/branches/disambiguation-engine/generic/servicesapi:1377975-1388016
+/incubator/stanbol/trunk/enhancer/generic/servicesapi:1339554,1339557-1339558,1386989-1388016
+/stanbol/branches/disambiguation-engine/generic/servicesapi:1388017-1403900
+/stanbol/trunk/enhancer/generic/servicesapi:1388017-1408754
Modified: stanbol/branches/stanbol-nlp-processing/enhancer/generic/servicesapi/pom.xml
URL: http://svn.apache.org/viewvc/stanbol/branches/stanbol-nlp-processing/enhancer/generic/servicesapi/pom.xml?rev=1410361&r1=1410360&r2=1410361&view=diff
==============================================================================
--- stanbol/branches/stanbol-nlp-processing/enhancer/generic/servicesapi/pom.xml (original)
+++ stanbol/branches/stanbol-nlp-processing/enhancer/generic/servicesapi/pom.xml Fri Nov 16 14:27:11 2012
@@ -33,12 +33,12 @@
<scm>
<connection>
- scm:svn:http://svn.apache.org/repos/asf/incubator/stanbol/trunk/enhancer/generic/servicesapi/
+ scm:svn:http://svn.apache.org/repos/asf/stanbol/trunk/enhancer/generic/servicesapi/
</connection>
<developerConnection>
- scm:svn:https://svn.apache.org/repos/asf/incubator/stanbol/trunk/enhancer/generic/servicesapi/
+ scm:svn:https://svn.apache.org/repos/asf/stanbol/trunk/enhancer/generic/servicesapi/
</developerConnection>
- <url>http://incubator.apache.org/stanbol/</url>
+ <url>http://stanbol.apache.org/</url>
</scm>
<build>
@@ -49,8 +49,10 @@
<extensions>true</extensions>
<configuration>
<instructions>
+ <!-- NOTE: define servicesapi package as provide:=true, because of the
+ included abstract implementations of some of those interfaces -->
<Export-Package>
- org.apache.stanbol.enhancer.servicesapi;version=${project.version},
+ org.apache.stanbol.enhancer.servicesapi;version=${project.version}; provide:=true,
org.apache.stanbol.enhancer.servicesapi.helper;version=${project.version},
org.apache.stanbol.enhancer.servicesapi.helper.execution;version=${project.version},
org.apache.stanbol.enhancer.servicesapi.impl;version=${project.version},
Modified: stanbol/branches/stanbol-nlp-processing/enhancer/generic/servicesapi/src/license/THIRD-PARTY.properties
URL: http://svn.apache.org/viewvc/stanbol/branches/stanbol-nlp-processing/enhancer/generic/servicesapi/src/license/THIRD-PARTY.properties?rev=1410361&r1=1410360&r2=1410361&view=diff
==============================================================================
--- stanbol/branches/stanbol-nlp-processing/enhancer/generic/servicesapi/src/license/THIRD-PARTY.properties (original)
+++ stanbol/branches/stanbol-nlp-processing/enhancer/generic/servicesapi/src/license/THIRD-PARTY.properties Fri Nov 16 14:27:11 2012
@@ -1,17 +1,24 @@
# Generated by org.codehaus.mojo.license.AddThirdPartyMojo
#-------------------------------------------------------------------------------
# Already used licenses in project :
-# - Apache License
-# - Common Development and Distribution License (CDDL) v1.0
-# - Common Public License Version 1.0
+# - Apache Software License
+# - Apache Software License, Version 2.0
+# - BSD License
+# - Common Development And Distribution License (CDDL), Version 1.0
+# - Common Development And Distribution License (CDDL), Version 1.1
+# - Common Public License, Version 1.0
+# - Eclipse Public License, Version 1.0
+# - GNU General Public License (GPL), Version 2 with classpath exception
+# - GNU Lesser General Public License (LGPL)
+# - GNU Lesser General Public License (LGPL), Version 2.1
# - ICU License
# - MIT License
-# - The Apache Software License, Version 2.0
+# - Public Domain License
#-------------------------------------------------------------------------------
# Please fill the missing licenses for dependencies :
#
#
-#Thu Feb 16 11:07:03 CET 2012
-javax.servlet--servlet-api--2.4=Common Development And Distribution License (CDDL), Version 1.0
+#Sun Oct 07 15:55:01 CEST 2012
+javax.servlet--servlet-api--2.5=Common Development And Distribution License (CDDL), Version 1.0
org.osgi--org.osgi.compendium--4.1.0=The Apache Software License, Version 2.0
org.osgi--org.osgi.core--4.1.0=The Apache Software License, Version 2.0
Modified: stanbol/branches/stanbol-nlp-processing/enhancer/generic/servicesapi/src/main/java/org/apache/stanbol/enhancer/servicesapi/ChainException.java
URL: http://svn.apache.org/viewvc/stanbol/branches/stanbol-nlp-processing/enhancer/generic/servicesapi/src/main/java/org/apache/stanbol/enhancer/servicesapi/ChainException.java?rev=1410361&r1=1410360&r2=1410361&view=diff
==============================================================================
--- stanbol/branches/stanbol-nlp-processing/enhancer/generic/servicesapi/src/main/java/org/apache/stanbol/enhancer/servicesapi/ChainException.java (original)
+++ stanbol/branches/stanbol-nlp-processing/enhancer/generic/servicesapi/src/main/java/org/apache/stanbol/enhancer/servicesapi/ChainException.java Fri Nov 16 14:27:11 2012
@@ -16,12 +16,12 @@
*/
package org.apache.stanbol.enhancer.servicesapi;
-import static org.apache.stanbol.enhancer.servicesapi.helper.ExecutionPlanHelper.getDependend;
-import static org.apache.stanbol.enhancer.servicesapi.helper.ExecutionPlanHelper.getEngine;
-import static org.apache.stanbol.enhancer.servicesapi.helper.ExecutionPlanHelper.isOptional;
-
-import org.apache.clerezza.rdf.core.Graph;
-import org.apache.clerezza.rdf.core.NonLiteral;
+//import static org.apache.stanbol.enhancer.servicesapi.helper.ExecutionPlanHelper.getDependend;
+//import static org.apache.stanbol.enhancer.servicesapi.helper.ExecutionPlanHelper.getEngine;
+//import static org.apache.stanbol.enhancer.servicesapi.helper.ExecutionPlanHelper.isOptional;
+//
+//import org.apache.clerezza.rdf.core.Graph;
+//import org.apache.clerezza.rdf.core.NonLiteral;
/**
* BaseException thrown by {@link Chain} implementations or
@@ -40,18 +40,20 @@ public class ChainException extends Enha
public ChainException(String message, Throwable cause) {
super(message,cause);
}
- /**
- * Creates a chain exception for the parsed node within the parsed executionPlan
- * @param executionPlan
- * @param node
- * @param message
- * @param cause
- */
- public ChainException(Graph executionPlan, NonLiteral node, String message, Throwable cause){
- super(String.format("Unable to execute node {} (engine: {} | optional : {}" +
- " | dependsOn : {}) because of: {}",
- node,getEngine(executionPlan, node),
- isOptional(executionPlan, node), getDependend(executionPlan, node),
- message == null || message.isEmpty() ? "<unknown>": message),cause);
- }
+
+//Removed - unused
+// /**
+// * Creates a chain exception for the parsed node within the parsed executionPlan
+// * @param executionPlan
+// * @param node
+// * @param message
+// * @param cause
+// */
+// public ChainException(Graph executionPlan, NonLiteral node, String message, Throwable cause){
+// super(String.format("Unable to execute node {} (engine: {} | optional : {}" +
+// " | dependsOn : {}) because of: {}",
+// node,getEngine(executionPlan, node),
+// isOptional(executionPlan, node), getDependend(executionPlan, node),
+// message == null || message.isEmpty() ? "<unknown>": message),cause);
+// }
}
Modified: stanbol/branches/stanbol-nlp-processing/enhancer/generic/servicesapi/src/main/java/org/apache/stanbol/enhancer/servicesapi/ContentItem.java
URL: http://svn.apache.org/viewvc/stanbol/branches/stanbol-nlp-processing/enhancer/generic/servicesapi/src/main/java/org/apache/stanbol/enhancer/servicesapi/ContentItem.java?rev=1410361&r1=1410360&r2=1410361&view=diff
==============================================================================
--- stanbol/branches/stanbol-nlp-processing/enhancer/generic/servicesapi/src/main/java/org/apache/stanbol/enhancer/servicesapi/ContentItem.java (original)
+++ stanbol/branches/stanbol-nlp-processing/enhancer/generic/servicesapi/src/main/java/org/apache/stanbol/enhancer/servicesapi/ContentItem.java Fri Nov 16 14:27:11 2012
@@ -17,10 +17,11 @@
package org.apache.stanbol.enhancer.servicesapi;
import java.io.InputStream;
+import java.util.concurrent.locks.Lock;
import java.util.concurrent.locks.ReadWriteLock;
+import org.apache.clerezza.rdf.core.MGraph;
import org.apache.clerezza.rdf.core.UriRef;
-import org.apache.clerezza.rdf.core.access.LockableMGraph;
/**
* A unit of content that Stanbol Enhancer can enhance.
@@ -51,12 +52,13 @@ public interface ContentItem {
/**
* Read/write lock used to synchronise access to the {@link #getMetadata()
* metadata} and the content parts of this content item.<p>
- * The lock used by the {@link LockableMGraph#getLock()} MUST BE the same
- * as the lock returned by this Instance. This is to avoid deadlocks when
- * using a lock while iterating over the {@link #getMetadata() metadata} and
- * simultaneously accessing the content parts. In other words
- * calling <code> contentItem.getLock() == contentItem.getMetadata().getLock()</code>
- * MUST BE <code>true</code>
+ * The lock needs to be used for reading and writing information from/to
+ * the ContentItem. In case the {@link MGraph} retured by {@link #getMetadata()}
+ * is an instanceof used by the {@link org.apache.clerezza.rdf.core.access.LockableMGraph}
+ * the {@link Lock} returned by this mehtod is the same as used by the
+ * metadata.This is to avoid deadlocks when using a lock while iterating over
+ * the {@link #getMetadata() metadata} and simultaneously accessing the content
+ * parts.
*
* @return the lock used for the content parts and the {@link LockableMGraph}
* containing the metadata of this content item.
@@ -64,7 +66,7 @@ public interface ContentItem {
ReadWriteLock getLock();
/** Optional metadata */
- LockableMGraph getMetadata();
+ MGraph getMetadata();
/**
* The main content of this content item
Modified: stanbol/branches/stanbol-nlp-processing/enhancer/generic/servicesapi/src/main/java/org/apache/stanbol/enhancer/servicesapi/ContentItemFactory.java
URL: http://svn.apache.org/viewvc/stanbol/branches/stanbol-nlp-processing/enhancer/generic/servicesapi/src/main/java/org/apache/stanbol/enhancer/servicesapi/ContentItemFactory.java?rev=1410361&r1=1410360&r2=1410361&view=diff
==============================================================================
--- stanbol/branches/stanbol-nlp-processing/enhancer/generic/servicesapi/src/main/java/org/apache/stanbol/enhancer/servicesapi/ContentItemFactory.java (original)
+++ stanbol/branches/stanbol-nlp-processing/enhancer/generic/servicesapi/src/main/java/org/apache/stanbol/enhancer/servicesapi/ContentItemFactory.java Fri Nov 16 14:27:11 2012
@@ -23,7 +23,6 @@ import java.io.OutputStream;
import org.apache.clerezza.rdf.core.MGraph;
import org.apache.clerezza.rdf.core.Triple;
import org.apache.clerezza.rdf.core.UriRef;
-import org.apache.stanbol.enhancer.servicesapi.helper.ContentItemHelper;
/**
* OSGI service to be used to create {@link ContentItem}s and Blobs.
@@ -54,7 +53,7 @@ public interface ContentItemFactory {
* Note the only a generated ID will be added to the passed prefix. So passed
* values should typically end with an separator char (e.g. '/', '#', ':').
* Implementors might want to use
- * {@link ContentItemHelper#streamDigest(InputStream, java.io.OutputStream, String)
+ * {@link org.apache.stanbol.enhancer.servicesapi.helper.ContentItemHelper#streamDigest(InputStream, java.io.OutputStream, String)
* for generating an ID while reading the data from the ContentSource.
* @param source The content source
* @return the {@link ContentItem} with a generated id and the passed
Modified: stanbol/branches/stanbol-nlp-processing/enhancer/generic/servicesapi/src/main/java/org/apache/stanbol/enhancer/servicesapi/helper/EnhancementEngineHelper.java
URL: http://svn.apache.org/viewvc/stanbol/branches/stanbol-nlp-processing/enhancer/generic/servicesapi/src/main/java/org/apache/stanbol/enhancer/servicesapi/helper/EnhancementEngineHelper.java?rev=1410361&r1=1410360&r2=1410361&view=diff
==============================================================================
--- stanbol/branches/stanbol-nlp-processing/enhancer/generic/servicesapi/src/main/java/org/apache/stanbol/enhancer/servicesapi/helper/EnhancementEngineHelper.java (original)
+++ stanbol/branches/stanbol-nlp-processing/enhancer/generic/servicesapi/src/main/java/org/apache/stanbol/enhancer/servicesapi/helper/EnhancementEngineHelper.java Fri Nov 16 14:27:11 2012
@@ -16,11 +16,13 @@
*/
package org.apache.stanbol.enhancer.servicesapi.helper;
+import static java.util.Collections.singleton;
import static org.apache.stanbol.enhancer.servicesapi.rdf.Properties.DC_LANGUAGE;
import static org.apache.stanbol.enhancer.servicesapi.rdf.Properties.RDF_TYPE;
import static org.apache.stanbol.enhancer.servicesapi.rdf.TechnicalClasses.ENHANCER_TEXTANNOTATION;
import java.util.ArrayList;
+import java.util.Collection;
import java.util.Collections;
import java.util.Comparator;
import java.util.Date;
@@ -35,6 +37,7 @@ import org.apache.clerezza.rdf.core.Lite
import org.apache.clerezza.rdf.core.LiteralFactory;
import org.apache.clerezza.rdf.core.MGraph;
import org.apache.clerezza.rdf.core.NonLiteral;
+import org.apache.clerezza.rdf.core.Resource;
import org.apache.clerezza.rdf.core.Triple;
import org.apache.clerezza.rdf.core.TripleCollection;
import org.apache.clerezza.rdf.core.TypedLiteral;
@@ -205,6 +208,23 @@ public class EnhancementEngineHelper {
return enhancement;
}
/**
+ * Adds the parsed {@link EnhancementEngine} as dc:contributer to the
+ * enhancement and also sets the dc:modified property accordingly
+ * @param metadata the {@link ContentItem#getMetadata()}
+ * @param enhancement the enhancement
+ * @param engine the engine
+ */
+ public static void addContributingEngine(MGraph metadata, UriRef enhancement,
+ EnhancementEngine engine){
+ LiteralFactory literalFactory = LiteralFactory.getInstance();
+ // TODO: use a public dereferencing URI instead?
+ metadata.add(new TripleImpl(enhancement, Properties.DC_CONTRIBUTOR,
+ literalFactory.createTypedLiteral(engine.getClass().getName())));
+ //set the modification date to the current date.
+ set(metadata,enhancement,Properties.DC_MODIFIED,new Date(),literalFactory);
+ }
+
+ /**
* Create a new extraction 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
@@ -288,6 +308,76 @@ public class EnhancementEngineHelper {
}
}
/**
+ * Replaces all current values of the property for the resource
+ * with the parsed value
+ * @param graph the graph
+ * @param resource the resource
+ * @param property the property
+ * @param value the value
+ */
+ public static void set(MGraph graph, NonLiteral resource, UriRef property, Resource value){
+ set(graph,resource,property,value == null ? null : singleton(value),null);
+ }
+ /**
+ * Replaces all current values of the property for the resource
+ * with the parsed values
+ * @param graph the graph
+ * @param resource the resource
+ * @param property the property
+ * @param value the value
+ */
+ public static void set(MGraph graph, NonLiteral resource, UriRef property, Collection<Resource> values){
+ set(graph,resource,property,values,null);
+ }
+
+ /**
+ * Replaces all current values of the property for the resource
+ * with the parsed value
+ * @param graph the graph
+ * @param resource the resource
+ * @param property the property
+ * @param value the value. In case it is an instance of {@link Resource} it
+ * is directly added to the graph. Otherwise the parsed {@link LiteralFactory}
+ * is used to create a {@link TypedLiteral} for the parsed value.
+ * @param literalFactory the {@link LiteralFactory} used in case the parsed
+ * value is not an {@link Resource}
+ */
+ public static void set(MGraph graph, NonLiteral resource, UriRef property,
+ Object value, LiteralFactory literalFactory){
+ set(graph,resource,property,value == null ? null : singleton(value),literalFactory);
+ }
+ /**
+ * Replaces all current values of the property for the resource
+ * with the parsed values
+ * @param graph the graph
+ * @param resource the resource
+ * @param property the property
+ * @param value the value. In case it is an instance of {@link Resource} it
+ * is directly added to the graph. Otherwise the parsed {@link LiteralFactory}
+ * is used to create a {@link TypedLiteral} for the parsed value.
+ * @param literalFactory the {@link LiteralFactory} used in case the parsed
+ * value is not an {@link Resource}
+ */
+ public static void set(MGraph graph, NonLiteral resource, UriRef property,
+ Collection<?> values, LiteralFactory literalFactory){
+ Iterator<Triple> currentValues = graph.filter(resource, property, null);
+ while(currentValues.hasNext()){
+ currentValues.next();
+ currentValues.remove();
+ }
+ if(values != null){
+ for(Object value : values){
+ if(value instanceof Resource){
+ graph.add(new TripleImpl(resource, property, (Resource) value));
+ } else if (value != null){
+ graph.add(new TripleImpl(resource, property,
+ literalFactory.createTypedLiteral(value)));
+ }
+ }
+ }
+ }
+
+ /**
* Getter for the typed literal values 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
Modified: stanbol/branches/stanbol-nlp-processing/enhancer/generic/servicesapi/src/main/java/org/apache/stanbol/enhancer/servicesapi/helper/ExecutionPlanHelper.java
URL: http://svn.apache.org/viewvc/stanbol/branches/stanbol-nlp-processing/enhancer/generic/servicesapi/src/main/java/org/apache/stanbol/enhancer/servicesapi/helper/ExecutionPlanHelper.java?rev=1410361&r1=1410360&r2=1410361&view=diff
==============================================================================
--- stanbol/branches/stanbol-nlp-processing/enhancer/generic/servicesapi/src/main/java/org/apache/stanbol/enhancer/servicesapi/helper/ExecutionPlanHelper.java (original)
+++ stanbol/branches/stanbol-nlp-processing/enhancer/generic/servicesapi/src/main/java/org/apache/stanbol/enhancer/servicesapi/helper/ExecutionPlanHelper.java Fri Nov 16 14:27:11 2012
@@ -57,9 +57,13 @@ import org.apache.stanbol.enhancer.servi
import org.apache.stanbol.enhancer.servicesapi.ServiceProperties;
import org.apache.stanbol.enhancer.servicesapi.impl.EnginesTracker;
import org.apache.stanbol.enhancer.servicesapi.rdf.ExecutionPlan;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
public final class ExecutionPlanHelper {
+ private final static Logger log = LoggerFactory.getLogger(ExecutionPlanHelper.class);
+
private static LiteralFactory lf = LiteralFactory.getInstance();
private ExecutionPlanHelper(){/* Do not allow instances of utility classes*/}
@@ -184,7 +188,14 @@ public final class ExecutionPlanHelper {
current = new HashSet<NonLiteral>();
prevOrder = order;
}
- current.add(writeExecutionNode(ep, epNode, name, optional.contains(name), prev));
+ try {
+ current.add(writeExecutionNode(ep, epNode, name, optional.contains(name), prev));
+ } catch (RuntimeException e){
+ //add the engine and class to ease debugging in such cases
+ log.error("Exception while writing ExecutionNode for Enhancement Eninge: "
+ + engine +"(class: "+engine.getClass()+")",e);
+ throw e; //rethrow it
+ }
}
return ep.getGraph();
}
Modified: stanbol/branches/stanbol-nlp-processing/enhancer/generic/servicesapi/src/main/java/org/apache/stanbol/enhancer/servicesapi/impl/AbstractEnhancementEngine.java
URL: http://svn.apache.org/viewvc/stanbol/branches/stanbol-nlp-processing/enhancer/generic/servicesapi/src/main/java/org/apache/stanbol/enhancer/servicesapi/impl/AbstractEnhancementEngine.java?rev=1410361&r1=1410360&r2=1410361&view=diff
==============================================================================
--- stanbol/branches/stanbol-nlp-processing/enhancer/generic/servicesapi/src/main/java/org/apache/stanbol/enhancer/servicesapi/impl/AbstractEnhancementEngine.java (original)
+++ stanbol/branches/stanbol-nlp-processing/enhancer/generic/servicesapi/src/main/java/org/apache/stanbol/enhancer/servicesapi/impl/AbstractEnhancementEngine.java Fri Nov 16 14:27:11 2012
@@ -93,7 +93,9 @@ public abstract class AbstractEnhancemen
public final String getName(){
return name;
}
-
+ /**
+ * Prints the simple name of the Class and the configured Name.
+ */
@Override
public String toString() {
return String.format("%s(name=%s)", getClass().getSimpleName(),name);
Modified: stanbol/branches/stanbol-nlp-processing/enhancer/generic/servicesapi/src/main/java/org/apache/stanbol/enhancer/servicesapi/rdf/Properties.java
URL: http://svn.apache.org/viewvc/stanbol/branches/stanbol-nlp-processing/enhancer/generic/servicesapi/src/main/java/org/apache/stanbol/enhancer/servicesapi/rdf/Properties.java?rev=1410361&r1=1410360&r2=1410361&view=diff
==============================================================================
--- stanbol/branches/stanbol-nlp-processing/enhancer/generic/servicesapi/src/main/java/org/apache/stanbol/enhancer/servicesapi/rdf/Properties.java (original)
+++ stanbol/branches/stanbol-nlp-processing/enhancer/generic/servicesapi/src/main/java/org/apache/stanbol/enhancer/servicesapi/rdf/Properties.java Fri Nov 16 14:27:11 2012
@@ -61,11 +61,27 @@ public class Properties {
+ "created");
/**
+ * Modification date of a resource. Used by Stanbol Enhancer to annotate the
+ * modification date of the enhancement if it was changed by an other
+ * enhancement engine as the one creating it. Multiple changes of the
+ * creating enhancement engines are not considered as modifications.
+ */
+ public static final UriRef DC_MODIFIED = new UriRef(NamespaceEnum.dc
+ + "modified");
+
+ /**
* The entity responsible for the creation of a resource. Used by Stanbol Enhancer to
* annotate the enhancement engine that created an enhancement
*/
public static final UriRef DC_CREATOR = new UriRef(NamespaceEnum.dc
+ "creator");
+ /**
+ * The entity contributed to a resource. Used by Stanbol Enhancer to
+ * annotate the enhancement engine that changed an enhancement originally
+ * created by an other enhancemetn engine
+ */
+ public static final UriRef DC_CONTRIBUTOR = new UriRef(NamespaceEnum.dc
+ + "contributor");
/**
* The nature or genre of the resource. Stanbol Enhancer uses this property to refer to
Modified: stanbol/branches/stanbol-nlp-processing/enhancer/generic/servicesapi/src/main/resources/fise.owl
URL: http://svn.apache.org/viewvc/stanbol/branches/stanbol-nlp-processing/enhancer/generic/servicesapi/src/main/resources/fise.owl?rev=1410361&r1=1410360&r2=1410361&view=diff
==============================================================================
--- stanbol/branches/stanbol-nlp-processing/enhancer/generic/servicesapi/src/main/resources/fise.owl (original)
+++ stanbol/branches/stanbol-nlp-processing/enhancer/generic/servicesapi/src/main/resources/fise.owl Fri Nov 16 14:27:11 2012
@@ -1,4 +1,20 @@
<?xml version="1.0"?>
+<!--
+ 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.
+-->
<rdf:RDF
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:protege="http://protege.stanford.edu/plugins/owl/protege#"