Modified: stanbol/trunk/enhancer/generic/servicesapi/src/main/java/org/apache/stanbol/enhancer/servicesapi/helper/ExecutionPlanHelper.java URL: http://svn.apache.org/viewvc/stanbol/trunk/enhancer/generic/servicesapi/src/main/java/org/apache/stanbol/enhancer/servicesapi/helper/ExecutionPlanHelper.java?rev=1744328&r1=1744327&r2=1744328&view=diff ============================================================================== --- stanbol/trunk/enhancer/generic/servicesapi/src/main/java/org/apache/stanbol/enhancer/servicesapi/helper/ExecutionPlanHelper.java (original) +++ stanbol/trunk/enhancer/generic/servicesapi/src/main/java/org/apache/stanbol/enhancer/servicesapi/helper/ExecutionPlanHelper.java Tue May 17 22:20:49 2016 @@ -41,21 +41,20 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; -import org.apache.clerezza.rdf.core.BNode; -import org.apache.clerezza.rdf.core.Graph; -import org.apache.clerezza.rdf.core.Literal; -import org.apache.clerezza.rdf.core.LiteralFactory; -import org.apache.clerezza.rdf.core.MGraph; +import org.apache.clerezza.commons.rdf.BlankNode; +import org.apache.clerezza.commons.rdf.ImmutableGraph; +import org.apache.clerezza.commons.rdf.Literal; +import org.apache.clerezza.commons.rdf.Graph; import org.apache.clerezza.rdf.core.NoConvertorException; -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; -import org.apache.clerezza.rdf.core.UriRef; -import org.apache.clerezza.rdf.core.impl.PlainLiteralImpl; -import org.apache.clerezza.rdf.core.impl.TripleImpl; -import org.apache.stanbol.commons.indexedgraph.IndexedMGraph; +import org.apache.clerezza.commons.rdf.BlankNodeOrIRI; +import org.apache.clerezza.commons.rdf.RDFTerm; +import org.apache.clerezza.commons.rdf.Triple; +import org.apache.clerezza.commons.rdf.Graph; +import org.apache.clerezza.commons.rdf.IRI; +import org.apache.clerezza.commons.rdf.impl.utils.PlainLiteralImpl; +import org.apache.clerezza.commons.rdf.impl.utils.TripleImpl; +import org.apache.clerezza.rdf.core.LiteralFactory; +import org.apache.stanbol.commons.indexedgraph.IndexedGraph; import org.apache.stanbol.enhancer.servicesapi.ChainException; import org.apache.stanbol.enhancer.servicesapi.EnhancementEngine; import org.apache.stanbol.enhancer.servicesapi.EnhancementEngineManager; @@ -75,28 +74,28 @@ public final class ExecutionPlanHelper { private ExecutionPlanHelper(){/* Do not allow instances of utility classes*/} /** - * Writes all triples for an ep:ExecutionNode to the parsed {@link MGraph}. - * An {@link BNode} is use for representing the execution node resource. + * Writes all triples for an ep:ExecutionNode to the parsed {@link Graph}. + * An {@link BlankNode} is use for representing the execution node resource. * @param graph the graph to write the triples. MUST NOT be empty - * @param epNode the NonLiteral representing the ep:ExecutionPlan + * @param epNode the BlankNodeOrIRI representing the ep:ExecutionPlan * @param engineName the name of the engine. MUST NOT be <code>null</code> nor empty * @param optional if the execution of this node is optional or required * @param dependsOn other nodes that MUST BE executed before this one. Parse * <code>null</code> or an empty set if none. * @return the resource representing the added ep:ExecutionNode. - * @deprecated use {@link #writeExecutionNode(MGraph, NonLiteral, String, boolean, Set, Map)} + * @deprecated use {@link #writeExecutionNode(Graph, BlankNodeOrIRI, String, boolean, Set, Map)} * with <code>null</code> as last parameter */ @Deprecated - public static NonLiteral writeExecutionNode(MGraph graph,NonLiteral epNode, - String engineName, boolean optional, Set<NonLiteral> dependsOn){ + public static BlankNodeOrIRI writeExecutionNode(Graph graph,BlankNodeOrIRI epNode, + String engineName, boolean optional, Set<BlankNodeOrIRI> dependsOn){ return writeExecutionNode(graph,epNode,engineName,optional,dependsOn, null); } /** - * Writes all triples for an ep:ExecutionNode to the parsed {@link MGraph}. - * An {@link BNode} is use for representing the execution node resource. + * Writes all triples for an ep:ExecutionNode to the parsed {@link Graph}. + * An {@link BlankNode} is use for representing the execution node resource. * @param graph the graph to write the triples. MUST NOT be empty - * @param epNode the NonLiteral representing the ep:ExecutionPlan + * @param epNode the BlankNodeOrIRI representing the ep:ExecutionPlan * @param engineName the name of the engine. MUST NOT be <code>null</code> nor empty * @param optional if the execution of this node is optional or required * @param dependsOn other nodes that MUST BE executed before this one. Parse @@ -106,11 +105,11 @@ public final class ExecutionPlanHelper { * @return the resource representing the added ep:ExecutionNode. * @since 0.12.1 */ - public static NonLiteral writeExecutionNode(MGraph graph,NonLiteral epNode, - String engineName, boolean optional, Set<NonLiteral> dependsOn, + public static BlankNodeOrIRI writeExecutionNode(Graph graph,BlankNodeOrIRI epNode, + String engineName, boolean optional, Set<BlankNodeOrIRI> dependsOn, Map<String,Object> enhProps){ if(graph == null){ - throw new IllegalArgumentException("The parsed MGraph MUST NOT be NULL!"); + throw new IllegalArgumentException("The parsed Graph MUST NOT be NULL!"); } if(engineName == null || engineName.isEmpty()){ throw new IllegalArgumentException("The parsed Engine name MUST NOT be NULL nor empty!"); @@ -118,12 +117,12 @@ public final class ExecutionPlanHelper { if(epNode == null){ throw new IllegalArgumentException("The ep:ExecutionPlan instance MUST NOT be NULL!"); } - NonLiteral node = new BNode(); + BlankNodeOrIRI node = new BlankNode(); graph.add(new TripleImpl(epNode, HAS_EXECUTION_NODE, node)); graph.add(new TripleImpl(node, RDF_TYPE, EXECUTION_NODE)); graph.add(new TripleImpl(node,ENGINE,new PlainLiteralImpl(engineName))); if(dependsOn != null){ - for(NonLiteral dependend : dependsOn){ + for(BlankNodeOrIRI dependend : dependsOn){ if(dependend != null){ graph.add(new TripleImpl(node, DEPENDS_ON, dependend)); } @@ -134,20 +133,20 @@ public final class ExecutionPlanHelper { return node; } /** - * Creates an ExecutionPlan for the parsed chainName in the parsed Graph + * Creates an ExecutionPlan for the parsed chainName in the parsed ImmutableGraph * @param graph the graph * @param chainName the chain name * @return the node representing the ex:ExecutionPlan - * @deprecated use {@link #createExecutionPlan(MGraph, String, Map)} with + * @deprecated use {@link #createExecutionPlan(Graph, String, Map)} with * parsing <code>null</code> as last parameter */ @Deprecated - public static NonLiteral createExecutionPlan(MGraph graph,String chainName){ + public static BlankNodeOrIRI createExecutionPlan(Graph graph,String chainName){ return createExecutionPlan(graph, chainName, null); } /** - * Creates an ExecutionPlan for the parsed chainName in the parsed Graph + * Creates an ExecutionPlan for the parsed chainName in the parsed ImmutableGraph * @param graph the graph * @param chainName the chain name * @param enhProps the map with the enhancement properties defined for the @@ -155,14 +154,14 @@ public final class ExecutionPlanHelper { * @return the node representing the ex:ExecutionPlan * @since 0.12.1 */ - public static NonLiteral createExecutionPlan(MGraph graph,String chainName, Map<String,Object> enhProps){ + public static BlankNodeOrIRI createExecutionPlan(Graph graph,String chainName, Map<String,Object> enhProps){ if(graph == null){ - throw new IllegalArgumentException("The parsed MGraph MUST NOT be NULL!"); + throw new IllegalArgumentException("The parsed Graph MUST NOT be NULL!"); } if(chainName == null || chainName.isEmpty()){ throw new IllegalArgumentException("The parsed Chain name MUST NOT be NULL nor empty!"); } - NonLiteral node = new BNode(); + BlankNodeOrIRI node = new BlankNode(); graph.add(new TripleImpl(node, RDF_TYPE, EXECUTION_PLAN)); graph.add(new TripleImpl(node, CHAIN,new PlainLiteralImpl(chainName))); writeEnhancementProperties(graph, node, null, enhProps); @@ -170,7 +169,7 @@ public final class ExecutionPlanHelper { } /** - * Evaluates the parsed {@link Graph execution plan} and the set of already executed + * Evaluates the parsed {@link ImmutableGraph execution plan} and the set of already executed * {@link ExecutionPlan#EXECUTION_NODE ep:ExecutionNode}s to find the next * nodes that can be executed. * @param executionPlan the execution plan @@ -179,10 +178,10 @@ public final class ExecutionPlanHelper { * @return the set of nodes that can be executed next or an empty set if * there are no more nodes to execute. */ - public static Set<NonLiteral>getExecutable(TripleCollection executionPlan, Set<NonLiteral> executed){ - Set<NonLiteral> executeable = new HashSet<NonLiteral>(); + public static Set<BlankNodeOrIRI>getExecutable(Graph executionPlan, Set<BlankNodeOrIRI> executed){ + Set<BlankNodeOrIRI> executeable = new HashSet<BlankNodeOrIRI>(); for(Iterator<Triple> nodes = executionPlan.filter(null, RDF_TYPE, EXECUTION_NODE);nodes.hasNext();){ - NonLiteral node = nodes.next().getSubject(); + BlankNodeOrIRI node = nodes.next().getSubject(); if(!executed.contains(node)){ Iterator<Triple> dependsIt = executionPlan.filter(node, DEPENDS_ON, null); boolean dependendExecuted = true; @@ -213,7 +212,7 @@ public final class ExecutionPlanHelper { * with <code>null</code> as last argument instead */ @Deprecated - public static Graph calculateExecutionPlan(String chainName, List<EnhancementEngine> availableEngines, + public static ImmutableGraph calculateExecutionPlan(String chainName, List<EnhancementEngine> availableEngines, Set<String> optional, Set<String> missing) { return calculateExecutionPlan(chainName, availableEngines, optional, missing, null); } @@ -240,7 +239,7 @@ public final class ExecutionPlanHelper { * @return the execution plan * @since 0.12.1 */ - public static Graph calculateExecutionPlan(String chainName, List<EnhancementEngine> availableEngines, + public static ImmutableGraph calculateExecutionPlan(String chainName, List<EnhancementEngine> availableEngines, Set<String> optional, Set<String> missing, Map<String,Map<String,Object>> enhProps) { if(chainName == null || chainName.isEmpty()){ throw new IllegalArgumentException("The parsed ChainName MUST NOT be empty!"); @@ -248,15 +247,15 @@ public final class ExecutionPlanHelper { Collections.sort(availableEngines,EXECUTION_ORDER_COMPARATOR); //now we have all required and possible also optional engines // -> build the execution plan - MGraph ep = new IndexedMGraph(); - NonLiteral epNode = createExecutionPlan(ep, chainName, + Graph ep = new IndexedGraph(); + BlankNodeOrIRI epNode = createExecutionPlan(ep, chainName, enhProps != null ? enhProps.get(null) : null); Integer prevOrder = null; - Set<NonLiteral> prev = null; - Set<NonLiteral> current = new HashSet<NonLiteral>(); + Set<BlankNodeOrIRI> prev = null; + Set<BlankNodeOrIRI> current = new HashSet<BlankNodeOrIRI>(); for(String name : missing){ boolean optionalMissing = optional.contains(name); - NonLiteral node = writeExecutionNode(ep, epNode, name, optionalMissing, null, + BlankNodeOrIRI node = writeExecutionNode(ep, epNode, name, optionalMissing, null, enhProps == null ? null : enhProps.get(name)); if(!optionalMissing){ current.add(node); @@ -267,11 +266,11 @@ public final class ExecutionPlanHelper { Integer order = getEngineOrder(engine); if(prevOrder == null || !prevOrder.equals(order)){ prev = current; - current = new HashSet<NonLiteral>(); + current = new HashSet<BlankNodeOrIRI>(); prevOrder = order; } try { - NonLiteral executionNode = writeExecutionNode(ep, epNode, name, + BlankNodeOrIRI executionNode = writeExecutionNode(ep, epNode, name, optional.contains(name), prev, enhProps == null ? null : enhProps.get(name)); current.add(executionNode); @@ -282,7 +281,7 @@ public final class ExecutionPlanHelper { throw e; //rethrow it } } - return ep.getGraph(); + return ep.getImmutableGraph(); } /** * Writes the enhancementProperties for an engine/chain to the parsed @@ -296,7 +295,7 @@ public final class ExecutionPlanHelper { * if none * @since 0.12.1 */ - private static void writeEnhancementProperties(MGraph ep, NonLiteral node, String engineName, + private static void writeEnhancementProperties(Graph ep, BlankNodeOrIRI node, String engineName, Map<String,Object> enhProps) { if(enhProps == null){ //no enhancement properties for this engine return; @@ -308,7 +307,7 @@ public final class ExecutionPlanHelper { engineName == null ? "" : engineName}); } else { writeEnhancementProperty(ep, node, - new UriRef(NamespaceEnum.ehp + enhprop.getKey()), + new IRI(NamespaceEnum.ehp + enhprop.getKey()), enhprop.getValue()); } } @@ -325,8 +324,8 @@ public final class ExecutionPlanHelper { * @throws NullPointerException if any of the parsed parameter is <code>null</code> */ @SuppressWarnings("unchecked") - private static void writeEnhancementProperty(MGraph ep, NonLiteral epNode, - UriRef property, Object value) { + private static void writeEnhancementProperty(Graph ep, BlankNodeOrIRI epNode, + IRI property, Object value) { Collection<Object> values; if(value instanceof Collection<?>){ values = (Collection<Object>)value; @@ -366,19 +365,19 @@ public final class ExecutionPlanHelper { * to an other execution node in the parsed graph * <ul><p> * This method does not modify the parsed graph. Therefore it is save - * to parse a {@link Graph} object.<p> + * to parse a {@link ImmutableGraph} object.<p> * TODO: There is no check for cycles implemented yet. * @param the graph to check * @return the engine names referenced by the validated execution plan- * @throws ChainException */ - public static Set<String> validateExecutionPlan(TripleCollection executionPlan) throws ChainException { + public static Set<String> validateExecutionPlan(Graph executionPlan) throws ChainException { Iterator<Triple> executionNodeIt = executionPlan.filter(null, RDF_TYPE, EXECUTION_NODE); Set<String> engineNames = new HashSet<String>(); - Map<NonLiteral, Collection<NonLiteral>> nodeDependencies = new HashMap<NonLiteral,Collection<NonLiteral>>(); + Map<BlankNodeOrIRI, Collection<BlankNodeOrIRI>> nodeDependencies = new HashMap<BlankNodeOrIRI,Collection<BlankNodeOrIRI>>(); //1. check the ExecutionNodes while(executionNodeIt.hasNext()){ - NonLiteral node = executionNodeIt.next().getSubject(); + BlankNodeOrIRI node = executionNodeIt.next().getSubject(); Iterator<String> engines = EnhancementEngineHelper.getStrings(executionPlan, node,ENGINE); if(!engines.hasNext()){ throw new ChainException("Execution Node "+node+" does not define " + @@ -394,11 +393,11 @@ public final class ExecutionPlanHelper { "an empty String as engine name (property "+ENGINE+")!"); } engineNames.add(engine); - Collection<NonLiteral> dependsOn = new HashSet<NonLiteral>(); + Collection<BlankNodeOrIRI> dependsOn = new HashSet<BlankNodeOrIRI>(); for(Iterator<Triple> t = executionPlan.filter(node, DEPENDS_ON, null);t.hasNext();){ - Resource o = t.next().getObject(); - if(o instanceof NonLiteral){ - dependsOn.add((NonLiteral)o); + RDFTerm o = t.next().getObject(); + if(o instanceof BlankNodeOrIRI){ + dependsOn.add((BlankNodeOrIRI)o); } else { throw new ChainException("Execution Node "+node+" defines the literal '" + o+"' as value for the "+DEPENDS_ON +" property. However this" + @@ -408,9 +407,9 @@ public final class ExecutionPlanHelper { nodeDependencies.put(node, dependsOn); } //2. now check the dependency graph - for(Entry<NonLiteral,Collection<NonLiteral>> entry : nodeDependencies.entrySet()){ + for(Entry<BlankNodeOrIRI,Collection<BlankNodeOrIRI>> entry : nodeDependencies.entrySet()){ if(entry.getValue() != null){ - for(NonLiteral dependent : entry.getValue()){ + for(BlankNodeOrIRI dependent : entry.getValue()){ if(!nodeDependencies.containsKey(dependent)){ throw new ChainException("Execution Node "+entry.getKey()+ " defines a dependency to an non existent ex:ExectutionNode "+ @@ -423,20 +422,20 @@ public final class ExecutionPlanHelper { return engineNames; } - public static Set<NonLiteral> getDependend(TripleCollection executionPlan, NonLiteral executionNode){ - Set<NonLiteral> dependend = new HashSet<NonLiteral>(); + public static Set<BlankNodeOrIRI> getDependend(Graph executionPlan, BlankNodeOrIRI executionNode){ + Set<BlankNodeOrIRI> dependend = new HashSet<BlankNodeOrIRI>(); addDependend(dependend, executionPlan, executionNode); return dependend; } - public static void addDependend(Collection<NonLiteral> collection, TripleCollection executionPlan, NonLiteral executionNode){ + public static void addDependend(Collection<BlankNodeOrIRI> collection, Graph executionPlan, BlankNodeOrIRI executionNode){ for(Iterator<Triple> it = executionPlan.filter(executionNode, DEPENDS_ON, null); - it.hasNext();collection.add((NonLiteral)it.next().getObject())); + it.hasNext();collection.add((BlankNodeOrIRI)it.next().getObject())); } - public static boolean isOptional(TripleCollection executionPlan, NonLiteral executionNode) { + public static boolean isOptional(Graph executionPlan, BlankNodeOrIRI executionNode) { Boolean optional = get(executionPlan,executionNode,OPTIONAL,Boolean.class,lf); return optional == null ? false : optional.booleanValue(); } - public static String getEngine(TripleCollection executionPlan, NonLiteral executionNode) { + public static String getEngine(Graph executionPlan, BlankNodeOrIRI executionNode) { return getString(executionPlan, executionNode, ENGINE); } @@ -447,13 +446,13 @@ public final class ExecutionPlanHelper { * @param ep the execution plan * @return */ - public static List<EnhancementEngine> getActiveEngines(EnhancementEngineManager engineManager, TripleCollection ep) { + public static List<EnhancementEngine> getActiveEngines(EnhancementEngineManager engineManager, Graph ep) { List<EnhancementEngine> engines = new ArrayList<EnhancementEngine>(); - Set<NonLiteral> visited = new HashSet<NonLiteral>(); - Set<NonLiteral> executeable; + Set<BlankNodeOrIRI> visited = new HashSet<BlankNodeOrIRI>(); + Set<BlankNodeOrIRI> executeable; do { executeable = getExecutable(ep, visited); - for(NonLiteral node : executeable){ + for(BlankNodeOrIRI node : executeable){ String engineName = getString(ep, node, ENGINE); EnhancementEngine engine = engineManager.getEngine(engineName); if(engine != null){ @@ -474,7 +473,7 @@ public final class ExecutionPlanHelper { * @param chainName the chain name * @return the node or <code>null</code> if not found */ - public static NonLiteral getExecutionPlan(TripleCollection graph, String chainName){ + public static BlankNodeOrIRI getExecutionPlan(Graph graph, String chainName){ if(graph == null){ throw new IllegalArgumentException("The parsed graph MUST NOT be NULL!"); } @@ -494,23 +493,23 @@ public final class ExecutionPlanHelper { * @param ep the execution plan graph * @param executionPlanNode the execution plan node */ - public static Set<NonLiteral> getExecutionNodes(TripleCollection ep, final NonLiteral executionPlanNode) { + public static Set<BlankNodeOrIRI> getExecutionNodes(Graph ep, final BlankNodeOrIRI executionPlanNode) { if(ep == null){ throw new IllegalArgumentException("The parsed graph with the Executionplan MUST NOT be NULL!"); } if(executionPlanNode == null){ throw new IllegalArgumentException("The parsed execution plan node MUST NOT be NULL!"); } - Set<NonLiteral> executionNodes = new HashSet<NonLiteral>(); + Set<BlankNodeOrIRI> executionNodes = new HashSet<BlankNodeOrIRI>(); Iterator<Triple> it = ep.filter(executionPlanNode, HAS_EXECUTION_NODE, null); while(it.hasNext()){ Triple t = it.next(); - Resource node = t.getObject(); - if(node instanceof NonLiteral){ - executionNodes.add((NonLiteral)node); + RDFTerm node = t.getObject(); + if(node instanceof BlankNodeOrIRI){ + executionNodes.add((BlankNodeOrIRI)node); } else { throw new IllegalStateException("The value of the "+HAS_EXECUTION_NODE - + " property MUST BE a NonLiteral (triple: "+t+")!"); + + " property MUST BE a BlankNodeOrIRI (triple: "+t+")!"); } } return executionNodes;
Modified: stanbol/trunk/enhancer/generic/servicesapi/src/main/java/org/apache/stanbol/enhancer/servicesapi/helper/execution/ChainExecution.java URL: http://svn.apache.org/viewvc/stanbol/trunk/enhancer/generic/servicesapi/src/main/java/org/apache/stanbol/enhancer/servicesapi/helper/execution/ChainExecution.java?rev=1744328&r1=1744327&r2=1744328&view=diff ============================================================================== --- stanbol/trunk/enhancer/generic/servicesapi/src/main/java/org/apache/stanbol/enhancer/servicesapi/helper/execution/ChainExecution.java (original) +++ stanbol/trunk/enhancer/generic/servicesapi/src/main/java/org/apache/stanbol/enhancer/servicesapi/helper/execution/ChainExecution.java Tue May 17 22:20:49 2016 @@ -16,8 +16,8 @@ */ package org.apache.stanbol.enhancer.servicesapi.helper.execution; -import org.apache.clerezza.rdf.core.NonLiteral; -import org.apache.clerezza.rdf.core.TripleCollection; +import org.apache.clerezza.commons.rdf.BlankNodeOrIRI; +import org.apache.clerezza.commons.rdf.Graph; import org.apache.stanbol.enhancer.servicesapi.helper.EnhancementEngineHelper; import org.apache.stanbol.enhancer.servicesapi.helper.ExecutionMetadataHelper; import org.apache.stanbol.enhancer.servicesapi.rdf.ExecutionPlan; @@ -32,9 +32,9 @@ public class ChainExecution extends Exec private final String chainName; - public ChainExecution(TripleCollection graph, NonLiteral node) { + public ChainExecution(Graph graph, BlankNodeOrIRI node) { super(null,graph,node); - NonLiteral ep = ExecutionMetadataHelper.getExecutionPlanNode(graph, node); + BlankNodeOrIRI ep = ExecutionMetadataHelper.getExecutionPlanNode(graph, node); if(ep != null){ chainName = EnhancementEngineHelper.getString(graph, ep, ExecutionPlan.CHAIN); } else { Modified: stanbol/trunk/enhancer/generic/servicesapi/src/main/java/org/apache/stanbol/enhancer/servicesapi/helper/execution/Execution.java URL: http://svn.apache.org/viewvc/stanbol/trunk/enhancer/generic/servicesapi/src/main/java/org/apache/stanbol/enhancer/servicesapi/helper/execution/Execution.java?rev=1744328&r1=1744327&r2=1744328&view=diff ============================================================================== --- stanbol/trunk/enhancer/generic/servicesapi/src/main/java/org/apache/stanbol/enhancer/servicesapi/helper/execution/Execution.java (original) +++ stanbol/trunk/enhancer/generic/servicesapi/src/main/java/org/apache/stanbol/enhancer/servicesapi/helper/execution/Execution.java Tue May 17 22:20:49 2016 @@ -20,9 +20,9 @@ import static org.apache.stanbol.enhance import java.util.Date; -import org.apache.clerezza.rdf.core.NonLiteral; -import org.apache.clerezza.rdf.core.TripleCollection; -import org.apache.clerezza.rdf.core.UriRef; +import org.apache.clerezza.commons.rdf.BlankNodeOrIRI; +import org.apache.clerezza.commons.rdf.Graph; +import org.apache.clerezza.commons.rdf.IRI; import org.apache.stanbol.enhancer.servicesapi.helper.ExecutionMetadataHelper; import org.apache.stanbol.enhancer.servicesapi.rdf.ExecutionMetadata; @@ -33,19 +33,19 @@ import org.apache.stanbol.enhancer.servi */ public class Execution implements Comparable<Execution>{ - protected final NonLiteral node; + protected final BlankNodeOrIRI node; private final ExecutionNode executionNode; - private final UriRef status; - protected final TripleCollection graph; + private final IRI status; + protected final Graph graph; private final Date started; private final Date completed; private final Long duration; private final ChainExecution chain; - public Execution(ChainExecution parent, TripleCollection graph, NonLiteral node) { + public Execution(ChainExecution parent, Graph graph, BlankNodeOrIRI node) { this.chain = parent; this.graph = graph; this.node = node; - NonLiteral executionNode = ExecutionMetadataHelper.getExecutionNode(graph, node); + BlankNodeOrIRI executionNode = ExecutionMetadataHelper.getExecutionNode(graph, node); if(executionNode != null){ this.executionNode = new ExecutionNode(graph, executionNode); } else { @@ -65,7 +65,7 @@ public class Execution implements Compar * The Status of the execution * @return the status */ - public final UriRef getStatus() { + public final IRI getStatus() { return status; } Modified: stanbol/trunk/enhancer/generic/servicesapi/src/main/java/org/apache/stanbol/enhancer/servicesapi/helper/execution/ExecutionMetadata.java URL: http://svn.apache.org/viewvc/stanbol/trunk/enhancer/generic/servicesapi/src/main/java/org/apache/stanbol/enhancer/servicesapi/helper/execution/ExecutionMetadata.java?rev=1744328&r1=1744327&r2=1744328&view=diff ============================================================================== --- stanbol/trunk/enhancer/generic/servicesapi/src/main/java/org/apache/stanbol/enhancer/servicesapi/helper/execution/ExecutionMetadata.java (original) +++ stanbol/trunk/enhancer/generic/servicesapi/src/main/java/org/apache/stanbol/enhancer/servicesapi/helper/execution/ExecutionMetadata.java Tue May 17 22:20:49 2016 @@ -20,9 +20,9 @@ import java.util.HashMap; import java.util.Map; import java.util.Set; -import org.apache.clerezza.rdf.core.NonLiteral; -import org.apache.clerezza.rdf.core.TripleCollection; -import org.apache.clerezza.rdf.core.UriRef; +import org.apache.clerezza.commons.rdf.BlankNodeOrIRI; +import org.apache.clerezza.commons.rdf.Graph; +import org.apache.clerezza.commons.rdf.IRI; import org.apache.stanbol.enhancer.servicesapi.helper.ExecutionMetadataHelper; public final class ExecutionMetadata { @@ -31,8 +31,8 @@ public final class ExecutionMetadata { private final ChainExecution chainExecution; private final Map<String,Execution> engineExecutions; - public static ExecutionMetadata parseFrom(TripleCollection executionMetadata, UriRef contentItemUri){ - NonLiteral ce = ExecutionMetadataHelper.getChainExecution(executionMetadata, contentItemUri); + public static ExecutionMetadata parseFrom(Graph executionMetadata, IRI contentItemUri){ + BlankNodeOrIRI ce = ExecutionMetadataHelper.getChainExecution(executionMetadata, contentItemUri); ExecutionMetadata em; if(ce != null){ em = new ExecutionMetadata(executionMetadata, contentItemUri,ce); @@ -42,10 +42,10 @@ public final class ExecutionMetadata { return em; } - private ExecutionMetadata(TripleCollection executionMetadata, UriRef contentItemUri, NonLiteral ce){ + private ExecutionMetadata(Graph executionMetadata, IRI contentItemUri, BlankNodeOrIRI ce){ chainExecution = new ChainExecution(executionMetadata, ce); engineExecutions = new HashMap<String,Execution>(); - for(NonLiteral ex : ExecutionMetadataHelper.getExecutions(executionMetadata, ce)){ + for(BlankNodeOrIRI ex : ExecutionMetadataHelper.getExecutions(executionMetadata, ce)){ Execution execution = new Execution(chainExecution,executionMetadata, ex); engineExecutions.put(execution.getExecutionNode().getEngineName(),execution); } Modified: stanbol/trunk/enhancer/generic/servicesapi/src/main/java/org/apache/stanbol/enhancer/servicesapi/helper/execution/ExecutionNode.java URL: http://svn.apache.org/viewvc/stanbol/trunk/enhancer/generic/servicesapi/src/main/java/org/apache/stanbol/enhancer/servicesapi/helper/execution/ExecutionNode.java?rev=1744328&r1=1744327&r2=1744328&view=diff ============================================================================== --- stanbol/trunk/enhancer/generic/servicesapi/src/main/java/org/apache/stanbol/enhancer/servicesapi/helper/execution/ExecutionNode.java (original) +++ stanbol/trunk/enhancer/generic/servicesapi/src/main/java/org/apache/stanbol/enhancer/servicesapi/helper/execution/ExecutionNode.java Tue May 17 22:20:49 2016 @@ -16,8 +16,8 @@ */ package org.apache.stanbol.enhancer.servicesapi.helper.execution; -import org.apache.clerezza.rdf.core.NonLiteral; -import org.apache.clerezza.rdf.core.TripleCollection; +import org.apache.clerezza.commons.rdf.BlankNodeOrIRI; +import org.apache.clerezza.commons.rdf.Graph; import org.apache.stanbol.enhancer.servicesapi.helper.ExecutionPlanHelper; /** @@ -27,12 +27,12 @@ import org.apache.stanbol.enhancer.servi */ public class ExecutionNode { - final NonLiteral node; - private final TripleCollection ep; + final BlankNodeOrIRI node; + private final Graph ep; private final boolean optional; private final String engineName; - public ExecutionNode(TripleCollection executionPlan, NonLiteral node) { + public ExecutionNode(Graph executionPlan, BlankNodeOrIRI node) { this.node = node; this.ep = executionPlan; this.optional = ExecutionPlanHelper.isOptional(ep, node); Modified: stanbol/trunk/enhancer/generic/servicesapi/src/main/java/org/apache/stanbol/enhancer/servicesapi/impl/AbstractContentItemFactory.java URL: http://svn.apache.org/viewvc/stanbol/trunk/enhancer/generic/servicesapi/src/main/java/org/apache/stanbol/enhancer/servicesapi/impl/AbstractContentItemFactory.java?rev=1744328&r1=1744327&r2=1744328&view=diff ============================================================================== --- stanbol/trunk/enhancer/generic/servicesapi/src/main/java/org/apache/stanbol/enhancer/servicesapi/impl/AbstractContentItemFactory.java (original) +++ stanbol/trunk/enhancer/generic/servicesapi/src/main/java/org/apache/stanbol/enhancer/servicesapi/impl/AbstractContentItemFactory.java Tue May 17 22:20:49 2016 @@ -20,9 +20,9 @@ import java.io.IOException; import java.io.InputStream; import java.util.Map; -import org.apache.clerezza.rdf.core.MGraph; -import org.apache.clerezza.rdf.core.Triple; -import org.apache.clerezza.rdf.core.UriRef; +import org.apache.clerezza.commons.rdf.Graph; +import org.apache.clerezza.commons.rdf.Triple; +import org.apache.clerezza.commons.rdf.IRI; import org.apache.felix.scr.annotations.Component; import org.apache.felix.scr.annotations.ConfigurationPolicy; import org.apache.felix.scr.annotations.Service; @@ -38,8 +38,8 @@ import org.apache.stanbol.enhancer.servi * Abstract implementation of the {@link ContentItemFactory} that requires only * the three abstract methods <ul> * <li> {@link #createBlob(ContentSource)} - * <li> {@link #createContentItem(String, Blob, MGraph)} - * <li> {@link #createContentItem(UriRef, Blob, MGraph)} + * <li> {@link #createContentItem(String, Blob, Graph)} + * <li> {@link #createContentItem(IRI, Blob, Graph)} * </ul> to be overridden.<p> * Implementers should NOTE that {@link #createBlob(ContentSource)} will be * called to create the main {@link Blob} instance for a contentItem before @@ -77,7 +77,7 @@ public abstract class AbstractContentIte @Override public final ContentItem createContentItem(ContentSource source) throws IOException { - return createContentItem((UriRef)null, source, null); + return createContentItem((IRI)null, source, null); } @Override @@ -86,7 +86,7 @@ public abstract class AbstractContentIte } @Override - public final ContentItem createContentItem(UriRef id, ContentSource source) throws IOException { + public final ContentItem createContentItem(IRI id, ContentSource source) throws IOException { return createContentItem(id, source, null); } @@ -96,14 +96,14 @@ public abstract class AbstractContentIte } @Override - public final ContentItem createContentItem(ContentReference reference, MGraph metadata) throws IOException { + public final ContentItem createContentItem(ContentReference reference, Graph metadata) throws IOException { if(reference == null){ throw new IllegalArgumentException("The parsed ContentReference MUST NOT be NULL!"); } - return createContentItem(new UriRef(reference.getReference()),createBlob(reference),metadata); + return createContentItem(new IRI(reference.getReference()),createBlob(reference),metadata); } @Override - public final ContentItem createContentItem(String prefix, ContentSource source,MGraph metadata) throws IOException { + public final ContentItem createContentItem(String prefix, ContentSource source,Graph metadata) throws IOException { if(prefix == null){ throw new IllegalArgumentException("The parsed prefix MUST NOT be NULL!"); } @@ -114,7 +114,7 @@ public abstract class AbstractContentIte } @Override - public final ContentItem createContentItem(UriRef id, ContentSource source, MGraph metadata) throws IOException { + public final ContentItem createContentItem(IRI id, ContentSource source, Graph metadata) throws IOException { if(source == null){ throw new IllegalArgumentException("The parsed ContentSource MUST NOT be NULL!"); } @@ -136,7 +136,7 @@ public abstract class AbstractContentIte * returned ContentItem. * @return the created content item */ - protected abstract ContentItem createContentItem(UriRef id, Blob blob, MGraph metadata); + protected abstract ContentItem createContentItem(IRI id, Blob blob, Graph metadata); /** * Creates a ContentItem for the parsed parameters @@ -152,7 +152,7 @@ public abstract class AbstractContentIte * returned ContentItem. * @return the created content item */ - protected abstract ContentItem createContentItem(String prefix, Blob blob, MGraph metadata); + protected abstract ContentItem createContentItem(String prefix, Blob blob, Graph metadata); @Override public abstract Blob createBlob(ContentSource source) throws IOException; Modified: stanbol/trunk/enhancer/generic/servicesapi/src/main/java/org/apache/stanbol/enhancer/servicesapi/impl/ContentItemImpl.java URL: http://svn.apache.org/viewvc/stanbol/trunk/enhancer/generic/servicesapi/src/main/java/org/apache/stanbol/enhancer/servicesapi/impl/ContentItemImpl.java?rev=1744328&r1=1744327&r2=1744328&view=diff ============================================================================== --- stanbol/trunk/enhancer/generic/servicesapi/src/main/java/org/apache/stanbol/enhancer/servicesapi/impl/ContentItemImpl.java (original) +++ stanbol/trunk/enhancer/generic/servicesapi/src/main/java/org/apache/stanbol/enhancer/servicesapi/impl/ContentItemImpl.java Tue May 17 22:20:49 2016 @@ -22,10 +22,8 @@ import java.util.Map; 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; -import org.apache.clerezza.rdf.core.access.LockableMGraphWrapper; +import org.apache.clerezza.commons.rdf.Graph; +import org.apache.clerezza.commons.rdf.IRI; import org.apache.stanbol.enhancer.servicesapi.Blob; import org.apache.stanbol.enhancer.servicesapi.ContentItem; import org.apache.stanbol.enhancer.servicesapi.NoSuchPartException; @@ -44,7 +42,7 @@ import org.apache.stanbol.enhancer.servi * it is marked as abstract and has only a protected constructor because it is * not intended that users directly instantiate it. The intended usage is to * create subclasses that instantiate ContentItmes with specific combinations - * of {@link Blob} nad {@link MGraph} implementations.<p> + * of {@link Blob} nad {@link Graph} implementations.<p> * Examples are: <ul> * <li>The {@link InMemoryContentItem} intended for in-memory * storage of ContentItems during the stateless enhancement workflow @@ -61,22 +59,22 @@ public abstract class ContentItemImpl im /** * Holds the content parts of this ContentItem */ - private final Map<UriRef, Object> parts = new LinkedHashMap<UriRef, Object>(); + private final Map<IRI, Object> parts = new LinkedHashMap<IRI, Object>(); /** * The uri of the ContentItem */ - private final UriRef uri; + private final IRI uri; /** * The uri of the main content part (the {@link Blob} parsed with the constructor) */ - private final UriRef mainBlobUri; + private final IRI mainBlobUri; - private final LockableMGraph metadata; + private final Graph metadata; protected final Lock readLock; protected final Lock writeLock; - protected ContentItemImpl(UriRef uri, Blob main, MGraph metadata) { + protected ContentItemImpl(IRI uri, Blob main, Graph metadata) { if(uri == null){ throw new IllegalArgumentException("The URI for the ContentItem MUST NOT be NULL!"); } @@ -87,19 +85,15 @@ public abstract class ContentItemImpl im throw new IllegalArgumentException("Tha parsed graph MUST NOT be NULL!"); } this.uri = uri; - this.mainBlobUri = new UriRef(uri.getUnicodeString()+MAIN_BLOB_SUFFIX); + this.mainBlobUri = new IRI(uri.getUnicodeString()+MAIN_BLOB_SUFFIX); this.parts.put(mainBlobUri, main); - if(metadata instanceof LockableMGraph){ - this.metadata = (LockableMGraph)metadata; - } else { - this.metadata = new LockableMGraphWrapper(metadata); - } + this.metadata = metadata; //init the read and write lock this.readLock = this.metadata.getLock().readLock(); this.writeLock = this.metadata.getLock().writeLock(); //Better parse the Blob in the Constructor than calling a public //method on a may be not fully initialised instance - //parts.put(new UriRef(uri.getUnicodeString()+"_main"), getBlob()); + //parts.put(new IRI(uri.getUnicodeString()+"_main"), getBlob()); } @Override @@ -108,7 +102,7 @@ public abstract class ContentItemImpl im } /** - * Final getter retrieving the Blob via {@link #getPart(UriRef, Class)} + * Final getter retrieving the Blob via {@link #getPart(IRI, Class)} * with <code>{@link #getUri()}+{@link #MAIN_BLOB_SUFFIX}</code> */ @Override @@ -131,7 +125,7 @@ public abstract class ContentItemImpl im @SuppressWarnings("unchecked") @Override - public <T> T getPart(UriRef uri, Class<T> clazz) throws NoSuchPartException { + public <T> T getPart(IRI uri, Class<T> clazz) throws NoSuchPartException { readLock.lock(); try { Object part = parts.get(uri); @@ -151,11 +145,11 @@ public abstract class ContentItemImpl im } @Override - public UriRef getPartUri(int index) throws NoSuchPartException { + public IRI getPartUri(int index) throws NoSuchPartException { readLock.lock(); try { int count = 0; - for(Map.Entry<UriRef, Object> entry : parts.entrySet()) { + for(Map.Entry<IRI, Object> entry : parts.entrySet()) { if (count == index) { return entry.getKey(); } @@ -174,7 +168,7 @@ public abstract class ContentItemImpl im try { Object result = null; int count = 0; - for(Map.Entry<UriRef, Object> entry : parts.entrySet()) { + for(Map.Entry<IRI, Object> entry : parts.entrySet()) { if (count == index) { result = entry.getValue(); if (!result.getClass().isAssignableFrom(clazz)) { @@ -191,7 +185,7 @@ public abstract class ContentItemImpl im } @Override - public Object addPart(UriRef uriRef, Object object) { + public Object addPart(IRI uriRef, Object object) { writeLock.lock(); try { if(uriRef == null || object == null){ @@ -219,20 +213,20 @@ public abstract class ContentItemImpl im } writeLock.lock(); try { - UriRef partUri = getPartUri(index); + IRI partUri = getPartUri(index); parts.remove(partUri); } finally { writeLock.unlock(); } } @Override - public void removePart(UriRef uriRef) { + public void removePart(IRI uriRef) { if(uriRef == null){ throw new IllegalArgumentException("The parsed uriRef MUST NOT be NULL!"); } writeLock.lock(); try { - UriRef mainContentPartUri = parts.keySet().iterator().next(); + IRI mainContentPartUri = parts.keySet().iterator().next(); if(uriRef.equals(mainContentPartUri)){ throw new IllegalStateException("The main ContentPart (uri '" + uriRef+"') CAN NOT be removed!"); @@ -246,12 +240,12 @@ public abstract class ContentItemImpl im } @Override - public UriRef getUri() { + public IRI getUri() { return uri; } @Override - public LockableMGraph getMetadata() { + public Graph getMetadata() { return metadata; } @Override Modified: stanbol/trunk/enhancer/generic/servicesapi/src/main/java/org/apache/stanbol/enhancer/servicesapi/impl/SingleEngineChain.java URL: http://svn.apache.org/viewvc/stanbol/trunk/enhancer/generic/servicesapi/src/main/java/org/apache/stanbol/enhancer/servicesapi/impl/SingleEngineChain.java?rev=1744328&r1=1744327&r2=1744328&view=diff ============================================================================== --- stanbol/trunk/enhancer/generic/servicesapi/src/main/java/org/apache/stanbol/enhancer/servicesapi/impl/SingleEngineChain.java (original) +++ stanbol/trunk/enhancer/generic/servicesapi/src/main/java/org/apache/stanbol/enhancer/servicesapi/impl/SingleEngineChain.java Tue May 17 22:20:49 2016 @@ -23,9 +23,9 @@ import java.util.Collections; import java.util.Map; import java.util.Set; -import org.apache.clerezza.rdf.core.Graph; -import org.apache.clerezza.rdf.core.MGraph; -import org.apache.stanbol.commons.indexedgraph.IndexedMGraph; +import org.apache.clerezza.commons.rdf.ImmutableGraph; +import org.apache.clerezza.commons.rdf.Graph; +import org.apache.stanbol.commons.indexedgraph.IndexedGraph; import org.apache.stanbol.enhancer.servicesapi.Chain; import org.apache.stanbol.enhancer.servicesapi.ChainException; import org.apache.stanbol.enhancer.servicesapi.EnhancementEngine; @@ -46,7 +46,7 @@ import org.apache.stanbol.enhancer.servi */ public class SingleEngineChain implements Chain { - private final Graph executionPlan; + private final ImmutableGraph executionPlan; private final EnhancementEngine engine; private final String name; @@ -71,14 +71,14 @@ public class SingleEngineChain implement } this.engine = engine; this.name = engine.getName()+"Chain"; - MGraph graph = new IndexedMGraph(); + Graph graph = new IndexedGraph(); writeExecutionNode(graph, createExecutionPlan(graph, name, null), engine.getName(), false, null, enhProps); - executionPlan = graph.getGraph(); + executionPlan = graph.getImmutableGraph(); } @Override - public Graph getExecutionPlan() throws ChainException { + public ImmutableGraph getExecutionPlan() throws ChainException { return executionPlan; } Modified: stanbol/trunk/enhancer/generic/servicesapi/src/main/java/org/apache/stanbol/enhancer/servicesapi/rdf/Enhancer.java URL: http://svn.apache.org/viewvc/stanbol/trunk/enhancer/generic/servicesapi/src/main/java/org/apache/stanbol/enhancer/servicesapi/rdf/Enhancer.java?rev=1744328&r1=1744327&r2=1744328&view=diff ============================================================================== --- stanbol/trunk/enhancer/generic/servicesapi/src/main/java/org/apache/stanbol/enhancer/servicesapi/rdf/Enhancer.java (original) +++ stanbol/trunk/enhancer/generic/servicesapi/src/main/java/org/apache/stanbol/enhancer/servicesapi/rdf/Enhancer.java Tue May 17 22:20:49 2016 @@ -16,7 +16,7 @@ */ package org.apache.stanbol.enhancer.servicesapi.rdf; -import org.apache.clerezza.rdf.core.UriRef; +import org.apache.clerezza.commons.rdf.IRI; public final class Enhancer { @@ -25,12 +25,12 @@ public final class Enhancer { */ private Enhancer() {} - public static final UriRef CONTENT_ITEM = new UriRef(NamespaceEnum.enhancer+"ContentItem"); - public static final UriRef ENHANCEMENT_ENGINE = new UriRef(NamespaceEnum.enhancer+"EnhancementEngine"); - public static final UriRef ENHANCEMENT_CHAIN = new UriRef(NamespaceEnum.enhancer+"EnhancementChain"); - public static final UriRef ENHANCER = new UriRef(NamespaceEnum.enhancer+"Enhancer"); - public static final UriRef HAS_ENGINE = new UriRef(NamespaceEnum.enhancer+"hasEngine"); - public static final UriRef HAS_CHAIN = new UriRef(NamespaceEnum.enhancer+"hasChain"); - public static final UriRef HAS_DEFAULT_CHAIN = new UriRef(NamespaceEnum.enhancer+"hasDefaultChain"); + public static final IRI CONTENT_ITEM = new IRI(NamespaceEnum.enhancer+"ContentItem"); + public static final IRI ENHANCEMENT_ENGINE = new IRI(NamespaceEnum.enhancer+"EnhancementEngine"); + public static final IRI ENHANCEMENT_CHAIN = new IRI(NamespaceEnum.enhancer+"EnhancementChain"); + public static final IRI ENHANCER = new IRI(NamespaceEnum.enhancer+"Enhancer"); + public static final IRI HAS_ENGINE = new IRI(NamespaceEnum.enhancer+"hasEngine"); + public static final IRI HAS_CHAIN = new IRI(NamespaceEnum.enhancer+"hasChain"); + public static final IRI HAS_DEFAULT_CHAIN = new IRI(NamespaceEnum.enhancer+"hasDefaultChain"); } Modified: stanbol/trunk/enhancer/generic/servicesapi/src/main/java/org/apache/stanbol/enhancer/servicesapi/rdf/ExecutionMetadata.java URL: http://svn.apache.org/viewvc/stanbol/trunk/enhancer/generic/servicesapi/src/main/java/org/apache/stanbol/enhancer/servicesapi/rdf/ExecutionMetadata.java?rev=1744328&r1=1744327&r2=1744328&view=diff ============================================================================== --- stanbol/trunk/enhancer/generic/servicesapi/src/main/java/org/apache/stanbol/enhancer/servicesapi/rdf/ExecutionMetadata.java (original) +++ stanbol/trunk/enhancer/generic/servicesapi/src/main/java/org/apache/stanbol/enhancer/servicesapi/rdf/ExecutionMetadata.java Tue May 17 22:20:49 2016 @@ -16,7 +16,7 @@ */ package org.apache.stanbol.enhancer.servicesapi.rdf; -import org.apache.clerezza.rdf.core.UriRef; +import org.apache.clerezza.commons.rdf.IRI; import org.apache.stanbol.enhancer.servicesapi.Chain; import org.apache.stanbol.enhancer.servicesapi.ChainManager; import org.apache.stanbol.enhancer.servicesapi.ContentItem; @@ -38,41 +38,41 @@ public final class ExecutionMetadata { * This is considered an abstract concept. Use {@link #CHAIN_EXECUTION} or * {@link #ENGINE_EXECUTION} depending on the type of the executed component. */ - public static final UriRef EXECUTION = new UriRef(NamespaceEnum.em+"Execution"); + public static final IRI EXECUTION = new IRI(NamespaceEnum.em+"Execution"); /** * Property that links {@link #EXECUTION} to its parent * {@link #CHAIN_EXECUTION}. */ - public static final UriRef EXECUTION_PART = new UriRef(NamespaceEnum.em+"executionPart"); + public static final IRI EXECUTION_PART = new IRI(NamespaceEnum.em+"executionPart"); /** * The current status of an {@link #EXECUTION}. Values are expected to be * one of {@link #EXECUTION_STATUS}. */ - public static final UriRef STATUS = new UriRef(NamespaceEnum.em+"status"); + public static final IRI STATUS = new IRI(NamespaceEnum.em+"status"); /** * The 'xsd:startTime' when an {@link #EXECUTION} started */ - public static final UriRef STARTED = new UriRef(NamespaceEnum.em+"started"); + public static final IRI STARTED = new IRI(NamespaceEnum.em+"started"); /** * The 'xsd:dateTime' when an {@link #EXECUTION} execution completed or * failed. */ - public static final UriRef COMPLETED = new UriRef(NamespaceEnum.em+"completed"); + public static final IRI COMPLETED = new IRI(NamespaceEnum.em+"completed"); /** * Allows to add a status message to a {@link #EXECUTION} node. */ - public static final UriRef STATUS_MESSAGE = new UriRef(NamespaceEnum.em+"statusMessage"); + public static final IRI STATUS_MESSAGE = new IRI(NamespaceEnum.em+"statusMessage"); /** * Class representing the execution of a {@link Chain}. This class is a * sub-class of {@link #EXECUTION} */ - public static final UriRef CHAIN_EXECUTION = new UriRef(NamespaceEnum.em+"ChainExecution"); + public static final IRI CHAIN_EXECUTION = new IRI(NamespaceEnum.em+"ChainExecution"); /** * Property indicating if the {@link ExecutionPlan#EXECUTION_PLAN} executed @@ -80,65 +80,65 @@ public final class ExecutionMetadata { * {@link Chain} at that time. Values are expected to be of data type * 'xsd:boolean'. */ - public static final UriRef IS_DEFAULT_CHAIN = new UriRef(NamespaceEnum.em+"defualtChain"); + public static final IRI IS_DEFAULT_CHAIN = new IRI(NamespaceEnum.em+"defualtChain"); /** * Property that links from the {@link #CHAIN_EXECUTION} to the * {@link ExecutionPlan#EXECUTION_PLAN} */ - public static final UriRef EXECUTION_PLAN = new UriRef(NamespaceEnum.em+"executionPlan"); + public static final IRI EXECUTION_PLAN = new IRI(NamespaceEnum.em+"executionPlan"); /** * Property that links from the {@link #CHAIN_EXECUTION} node to the * enhanced {@link ContentItem#getUri()} */ - public static final UriRef ENHANCES = new UriRef(NamespaceEnum.em+"enhances"); + public static final IRI ENHANCES = new IRI(NamespaceEnum.em+"enhances"); /** * Property that links from {@link ContentItem#getUri()} to the * {@link #CHAIN_EXECUTION} defining the root node of the execution metadata */ - public static final UriRef ENHANCED_BY = new UriRef(NamespaceEnum.em+"enhancedBy"); + public static final IRI ENHANCED_BY = new IRI(NamespaceEnum.em+"enhancedBy"); /** * Class that represents the execution of an {@link EnhancementEngine}. * This is a sub-class of {@link #EXECUTION}. */ - public static final UriRef ENGINE_EXECUTION = new UriRef(NamespaceEnum.em+"EngineExecution"); + public static final IRI ENGINE_EXECUTION = new IRI(NamespaceEnum.em+"EngineExecution"); /** * Property that links from the {@link #ENGINE_EXECUTION} to the * {@link ExecutionPlan#EXECUTION_NODE} */ - public static final UriRef EXECUTION_NODE = new UriRef(NamespaceEnum.em+"executionNode"); + public static final IRI EXECUTION_NODE = new IRI(NamespaceEnum.em+"executionNode"); /** * Type for all ExecutionStatus values: {@link #STATUS_SCHEDULED}, * {@link #STATUS_IN_PROGRESS}, {@link #STATUS_COMPLETED}, {@link #STATUS_SKIPPED}, * {@link #STATUS_FAILED}. */ - public static final UriRef EXECUTION_STATUS = new UriRef(NamespaceEnum.em+"ExecutionStatus"); + public static final IRI EXECUTION_STATUS = new IRI(NamespaceEnum.em+"ExecutionStatus"); /** * em:ExecutionStatus indicating that the execution is scheduled, but has not yet started */ - public static final UriRef STATUS_SCHEDULED = new UriRef(NamespaceEnum.em+"StatusSheduled"); + public static final IRI STATUS_SCHEDULED = new IRI(NamespaceEnum.em+"StatusSheduled"); /** * em:ExecutionStatus indicating that the execution was skipped */ - public static final UriRef STATUS_SKIPPED = new UriRef(NamespaceEnum.em+"StatusSkipped"); + public static final IRI STATUS_SKIPPED = new IRI(NamespaceEnum.em+"StatusSkipped"); /** * em:ExecutionStatus indicating that the execution is in progress */ - public static final UriRef STATUS_IN_PROGRESS = new UriRef(NamespaceEnum.em+"StatusInProgress"); + public static final IRI STATUS_IN_PROGRESS = new IRI(NamespaceEnum.em+"StatusInProgress"); /** * em:ExecutionStatus indicating that the execution has completed successfully */ - public static final UriRef STATUS_COMPLETED = new UriRef(NamespaceEnum.em+"StatusCompleted"); + public static final IRI STATUS_COMPLETED = new IRI(NamespaceEnum.em+"StatusCompleted"); /** * em:ExecutionStatus indicating that the execution has failed */ - public static final UriRef STATUS_FAILED = new UriRef(NamespaceEnum.em+"StatusFailed"); + public static final IRI STATUS_FAILED = new IRI(NamespaceEnum.em+"StatusFailed"); } Modified: stanbol/trunk/enhancer/generic/servicesapi/src/main/java/org/apache/stanbol/enhancer/servicesapi/rdf/ExecutionPlan.java URL: http://svn.apache.org/viewvc/stanbol/trunk/enhancer/generic/servicesapi/src/main/java/org/apache/stanbol/enhancer/servicesapi/rdf/ExecutionPlan.java?rev=1744328&r1=1744327&r2=1744328&view=diff ============================================================================== --- stanbol/trunk/enhancer/generic/servicesapi/src/main/java/org/apache/stanbol/enhancer/servicesapi/rdf/ExecutionPlan.java (original) +++ stanbol/trunk/enhancer/generic/servicesapi/src/main/java/org/apache/stanbol/enhancer/servicesapi/rdf/ExecutionPlan.java Tue May 17 22:20:49 2016 @@ -16,11 +16,11 @@ */ package org.apache.stanbol.enhancer.servicesapi.rdf; -import org.apache.clerezza.rdf.core.UriRef; +import org.apache.clerezza.commons.rdf.IRI; import org.apache.stanbol.enhancer.servicesapi.EnhancementEngine; /** - * Defines the {@link UriRef}s for all classes and properties defined by the + * Defines the {@link IRI}s for all classes and properties defined by the * Stanbol Enhancer Execution Plan ontology. * */ @@ -30,35 +30,35 @@ public final class ExecutionPlan { /** * The Class ep:ExecutionPlan */ - public static final UriRef EXECUTION_PLAN = new UriRef(NamespaceEnum.ep+"ExecutionPlan"); + public static final IRI EXECUTION_PLAN = new IRI(NamespaceEnum.ep+"ExecutionPlan"); /** * The property ep:chain linking an {@link #EXECUTION_PLAN} to the name * of the chain this plan is defined for */ - public static final UriRef CHAIN = new UriRef(NamespaceEnum.ep+"chain"); + public static final IRI CHAIN = new IRI(NamespaceEnum.ep+"chain"); /** * the property ep:hasExecutionNode linking an {@link #EXECUTION_PLAN} with * all its {@link #EXECUTION_NODE}s */ - public static final UriRef HAS_EXECUTION_NODE = new UriRef(NamespaceEnum.ep+"hasExecutionNode"); + public static final IRI HAS_EXECUTION_NODE = new IRI(NamespaceEnum.ep+"hasExecutionNode"); /** * The Class ep:ExecutionMode */ - public static final UriRef EXECUTION_NODE = new UriRef(NamespaceEnum.ep+"ExecutionNode"); + public static final IRI EXECUTION_NODE = new IRI(NamespaceEnum.ep+"ExecutionNode"); /** * The property ep:engine linking an {@link #EXECUTION_NODE} with the name of * the {@link EnhancementEngine} to be executed. */ - public static final UriRef ENGINE = new UriRef(NamespaceEnum.ep+"engine"); + public static final IRI ENGINE = new IRI(NamespaceEnum.ep+"engine"); /** * The property ep:dependsOn defining the list of other {@link #EXECUTION_NODE}s * this one depends on */ - public static final UriRef DEPENDS_ON = new UriRef(NamespaceEnum.ep+"dependsOn"); + public static final IRI DEPENDS_ON = new IRI(NamespaceEnum.ep+"dependsOn"); /** * The property ep:optional that can be used to define that the execution of * an {@link #EXECUTION_NODE} is optional. The default is <code>false</code>. */ - public static final UriRef OPTIONAL = new UriRef(NamespaceEnum.ep+"optional"); + public static final IRI OPTIONAL = new IRI(NamespaceEnum.ep+"optional"); } Modified: stanbol/trunk/enhancer/generic/servicesapi/src/main/java/org/apache/stanbol/enhancer/servicesapi/rdf/OntologicalClasses.java URL: http://svn.apache.org/viewvc/stanbol/trunk/enhancer/generic/servicesapi/src/main/java/org/apache/stanbol/enhancer/servicesapi/rdf/OntologicalClasses.java?rev=1744328&r1=1744327&r2=1744328&view=diff ============================================================================== --- stanbol/trunk/enhancer/generic/servicesapi/src/main/java/org/apache/stanbol/enhancer/servicesapi/rdf/OntologicalClasses.java (original) +++ stanbol/trunk/enhancer/generic/servicesapi/src/main/java/org/apache/stanbol/enhancer/servicesapi/rdf/OntologicalClasses.java Tue May 17 22:20:49 2016 @@ -16,7 +16,7 @@ */ package org.apache.stanbol.enhancer.servicesapi.rdf; -import org.apache.clerezza.rdf.core.UriRef; +import org.apache.clerezza.commons.rdf.IRI; /** * Common entity types, a.k.a. ontological classes to be used as valuation of @@ -30,19 +30,19 @@ import org.apache.clerezza.rdf.core.UriR */ public final class OntologicalClasses { - public static final UriRef DBPEDIA_PERSON = new UriRef( + public static final IRI DBPEDIA_PERSON = new IRI( NamespaceEnum.dbpedia_ont+"Person"); - public static final UriRef DBPEDIA_PLACE = new UriRef( + public static final IRI DBPEDIA_PLACE = new IRI( NamespaceEnum.dbpedia_ont+"Place"); - public static final UriRef DBPEDIA_ORGANISATION = new UriRef( + public static final IRI DBPEDIA_ORGANISATION = new IRI( NamespaceEnum.dbpedia_ont+"Organisation"); - public static final UriRef SKOS_CONCEPT = new UriRef( + public static final IRI SKOS_CONCEPT = new IRI( NamespaceEnum.skos+"Concept"); - public static final UriRef DC_LINGUISTIC_SYSTEM = new UriRef( + public static final IRI DC_LINGUISTIC_SYSTEM = new IRI( NamespaceEnum.dc+"LinguisticSystem"); private OntologicalClasses() { Modified: stanbol/trunk/enhancer/generic/servicesapi/src/main/java/org/apache/stanbol/enhancer/servicesapi/rdf/Properties.java URL: http://svn.apache.org/viewvc/stanbol/trunk/enhancer/generic/servicesapi/src/main/java/org/apache/stanbol/enhancer/servicesapi/rdf/Properties.java?rev=1744328&r1=1744327&r2=1744328&view=diff ============================================================================== --- stanbol/trunk/enhancer/generic/servicesapi/src/main/java/org/apache/stanbol/enhancer/servicesapi/rdf/Properties.java (original) +++ stanbol/trunk/enhancer/generic/servicesapi/src/main/java/org/apache/stanbol/enhancer/servicesapi/rdf/Properties.java Tue May 17 22:20:49 2016 @@ -16,8 +16,7 @@ */ package org.apache.stanbol.enhancer.servicesapi.rdf; -import org.apache.clerezza.rdf.core.PlainLiteral; -import org.apache.clerezza.rdf.core.UriRef; +import org.apache.clerezza.commons.rdf.IRI; /** * Namespace of standard properties to be used as typed metadata by @@ -41,12 +40,12 @@ public final class Properties { * the target of this property is an owl:Class such as the ones defined is * {@link OntologyClass} */ - public static final UriRef RDF_TYPE = new UriRef(NamespaceEnum.rdf + "type"); + public static final IRI RDF_TYPE = new IRI(NamespaceEnum.rdf + "type"); /** * A label for resources of any type. */ - public static final UriRef RDFS_LABEL = new UriRef(NamespaceEnum.rdfs + public static final IRI RDFS_LABEL = new IRI(NamespaceEnum.rdfs + "label"); /** @@ -56,14 +55,14 @@ public final class Properties { * @deprecated use ENHANCER_ENTITY instead */ @Deprecated - public static final UriRef DC_REFERENCES = new UriRef(NamespaceEnum.dc + public static final IRI DC_REFERENCES = new IRI(NamespaceEnum.dc + "references"); /** * Creation date of a resource. Used by Stanbol Enhancer to annotate the creation date * of the enhancement by the enhancement engine */ - public static final UriRef DC_CREATED = new UriRef(NamespaceEnum.dc + public static final IRI DC_CREATED = new IRI(NamespaceEnum.dc + "created"); /** @@ -72,21 +71,21 @@ public final class Properties { * 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 + public static final IRI DC_MODIFIED = new IRI(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 + public static final IRI DC_CREATOR = new IRI(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 + public static final IRI DC_CONTRIBUTOR = new IRI(NamespaceEnum.dc + "contributor"); /** @@ -94,21 +93,21 @@ public final class Properties { * the type of the enhancement. Values should be URIs defined in some * controlled vocabulary */ - public static final UriRef DC_TYPE = new UriRef(NamespaceEnum.dc + "type"); + public static final IRI DC_TYPE = new IRI(NamespaceEnum.dc + "type"); /** * A related resource that is required by the described resource to support * its function, delivery, or coherence. Stanbol Enhancer uses this property to refer to * other enhancements an enhancement depends on. */ - public static final UriRef DC_REQUIRES = new UriRef(NamespaceEnum.dc + public static final IRI DC_REQUIRES = new IRI(NamespaceEnum.dc + "requires"); /** * A related resource. Stanbol Enhancer uses this property to define enhancements that * are referred by the actual one */ - public static final UriRef DC_RELATION = new UriRef(NamespaceEnum.dc + public static final IRI DC_RELATION = new IRI(NamespaceEnum.dc + "relation"); /** @@ -117,54 +116,54 @@ public final class Properties { * separator. */ @Deprecated - public static final UriRef GEORSS_POINT = new UriRef(NamespaceEnum.georss + public static final IRI GEORSS_POINT = new IRI(NamespaceEnum.georss + "point"); @Deprecated - public static final UriRef GEO_LAT = new UriRef(NamespaceEnum.geo + "lat"); + public static final IRI GEO_LAT = new IRI(NamespaceEnum.geo + "lat"); @Deprecated - public static final UriRef GEO_LONG = new UriRef(NamespaceEnum.geo + "long"); + public static final IRI GEO_LONG = new IRI(NamespaceEnum.geo + "long"); - public static final UriRef SKOS_BROADER = new UriRef(NamespaceEnum.skos + "broader"); + public static final IRI SKOS_BROADER = new IRI(NamespaceEnum.skos + "broader"); - public static final UriRef SKOS_NARROWER = new UriRef(NamespaceEnum.skos + "narrower"); + public static final IRI SKOS_NARROWER = new IRI(NamespaceEnum.skos + "narrower"); /** * Refers to the content item the enhancement was extracted form */ - public static final UriRef ENHANCER_EXTRACTED_FROM = new UriRef( + public static final IRI ENHANCER_EXTRACTED_FROM = new IRI( NamespaceEnum.fise + "extracted-from"); /** * the character position of the start of a text selection. */ - public static final UriRef ENHANCER_START = new UriRef(NamespaceEnum.fise + public static final IRI ENHANCER_START = new IRI(NamespaceEnum.fise + "start"); /** * the character position of the end of a text selection. */ - public static final UriRef ENHANCER_END = new UriRef(NamespaceEnum.fise + "end"); + public static final IRI ENHANCER_END = new IRI(NamespaceEnum.fise + "end"); /** * The text selected by the text annotation. This is an optional property */ - public static final UriRef ENHANCER_SELECTED_TEXT = new UriRef( + public static final IRI ENHANCER_SELECTED_TEXT = new IRI( NamespaceEnum.fise + "selected-text"); /** * The context (surroundings) of the text selected. (e.g. the sentence * containing a person selected by a NLP enhancer) */ - public static final UriRef ENHANCER_SELECTION_CONTEXT = new UriRef( + public static final IRI ENHANCER_SELECTION_CONTEXT = new IRI( NamespaceEnum.fise + "selection-context"); /** * The prefix of the {@link #ENHANCER_SELECTED_TEXT}. Intended to be used * to find the exact position within the text if char indexes can not be used * @since 0.11.0 */ - public final static UriRef ENHANCER_SELECTION_PREFIX = new UriRef( + public final static IRI ENHANCER_SELECTION_PREFIX = new IRI( NamespaceEnum.fise + "selection-prefix"); /** * The first few chars of the {@link #ENHANCER_SELECTED_TEXT}. To be used if @@ -172,7 +171,7 @@ public final class Properties { * e.g. when selection sentences or whole sections of the text). * @since 0.11.0 */ - public final static UriRef ENHANCER_SELECTION_HEAD = new UriRef( + public final static IRI ENHANCER_SELECTION_HEAD = new IRI( NamespaceEnum.fise + "selection-head"); /** * The last few chars of the {@link #ENHANCER_SELECTED_TEXT}. To be used if @@ -180,45 +179,45 @@ public final class Properties { * e.g. when selection sentences or whole sections of the text). * @since 0.11.0 */ - public final static UriRef ENHANCER_SELECTION_TAIL = new UriRef( + public final static IRI ENHANCER_SELECTION_TAIL = new IRI( NamespaceEnum.fise + "selection-tail"); /** * The suffix of the {@link #ENHANCER_SELECTED_TEXT}. Intended to be used * to find the exact position within the text if char indexes can not be used * @since 0.11.0 */ - public final static UriRef ENHANCER_SELECTION_SUFFIX = new UriRef( + public final static IRI ENHANCER_SELECTION_SUFFIX = new IRI( NamespaceEnum.fise + "selection-suffix"); /** * A positive double value to rank extractions according to the algorithm * confidence in the accuracy of the extraction. */ - public static final UriRef ENHANCER_CONFIDENCE = new UriRef(NamespaceEnum.fise + public static final IRI ENHANCER_CONFIDENCE = new IRI(NamespaceEnum.fise + "confidence"); /** * This refers to the URI identifying the referred named entity */ - public static final UriRef ENHANCER_ENTITY_REFERENCE = new UriRef( + public static final IRI ENHANCER_ENTITY_REFERENCE = new IRI( NamespaceEnum.fise + "entity-reference"); /** * This property can be used to specify the type of the entity (Optional) */ - public static final UriRef ENHANCER_ENTITY_TYPE = new UriRef(NamespaceEnum.fise + public static final IRI ENHANCER_ENTITY_TYPE = new IRI(NamespaceEnum.fise + "entity-type"); /** * The label(s) of the referred entity */ - public static final UriRef ENHANCER_ENTITY_LABEL = new UriRef( + public static final IRI ENHANCER_ENTITY_LABEL = new IRI( NamespaceEnum.fise + "entity-label"); /** * The confidence level (introducdes by * <a herf="https://issues.apache.org/jira/browse/STANBOL-631">STANBOL-631</a>) */ - public static final UriRef ENHANCER_CONFIDENCE_LEVEL = new UriRef( + public static final IRI ENHANCER_CONFIDENCE_LEVEL = new IRI( NamespaceEnum.fise + "confidence-level"); /** @@ -228,7 +227,7 @@ public final class Properties { * originates from. * @since 0.12.1 (STANBOL-1391) */ - public static final UriRef ENHANCER_ORIGIN = new UriRef( + public static final IRI ENHANCER_ORIGIN = new IRI( NamespaceEnum.fise + "origin"); /** @@ -237,13 +236,13 @@ public final class Properties { * @deprecated dc:FileFormat does not exist */ @Deprecated - public static final UriRef DC_FILEFORMAT = new UriRef(NamespaceEnum.dc + public static final IRI DC_FILEFORMAT = new IRI(NamespaceEnum.dc + "FileFormat"); /** * Language of the content item text. */ - public static final UriRef DC_LANGUAGE = new UriRef(NamespaceEnum.dc + public static final IRI DC_LANGUAGE = new IRI(NamespaceEnum.dc + "language"); @@ -255,45 +254,45 @@ public final class Properties { * specification */ @Deprecated - public static final UriRef DC_SUBJECT = new UriRef(NamespaceEnum.dc + public static final IRI DC_SUBJECT = new IRI(NamespaceEnum.dc + "subject"); /** * The sha1 hexadecimal digest of a content item. */ @Deprecated - public static final UriRef FOAF_SHA1 = new UriRef(NamespaceEnum.foaf + public static final IRI FOAF_SHA1 = new IRI(NamespaceEnum.foaf + "sha1"); /** * Link an semantic extraction or a manual annotation to a content item. */ @Deprecated - public static final UriRef ENHANCER_RELATED_CONTENT_ITEM = new UriRef( + public static final IRI ENHANCER_RELATED_CONTENT_ITEM = new IRI( "http://iksproject.eu/ns/extraction/source-content-item"); @Deprecated - public static final UriRef ENHANCER_RELATED_TOPIC = new UriRef( + public static final IRI ENHANCER_RELATED_TOPIC = new IRI( "http://iksproject.eu/ns/extraction/related-topic"); @Deprecated - public static final UriRef ENHANCER_RELATED_TOPIC_LABEL = new UriRef( + public static final IRI ENHANCER_RELATED_TOPIC_LABEL = new IRI( "http://iksproject.eu/ns/extraction/related-topic-label"); @Deprecated - public static final UriRef ENHANCER_MENTIONED_ENTITY_POSITION_START = new UriRef( + public static final IRI ENHANCER_MENTIONED_ENTITY_POSITION_START = new IRI( "http://iksproject.eu/ns/extraction/mention/position-start"); @Deprecated - public static final UriRef ENHANCER_MENTIONED_ENTITY_POSITION_END = new UriRef( + public static final IRI ENHANCER_MENTIONED_ENTITY_POSITION_END = new IRI( "http://iksproject.eu/ns/extraction/mention/position-end"); @Deprecated - public static final UriRef ENHANCER_MENTIONED_ENTITY_CONTEXT = new UriRef( + public static final IRI ENHANCER_MENTIONED_ENTITY_CONTEXT = new IRI( "http://iksproject.eu/ns/extraction/mention/context"); @Deprecated - public static final UriRef ENHANCER_MENTIONED_ENTITY_OCCURENCE = new UriRef( + public static final IRI ENHANCER_MENTIONED_ENTITY_OCCURENCE = new IRI( "http://iksproject.eu/ns/extraction/mention/occurence"); } Modified: stanbol/trunk/enhancer/generic/servicesapi/src/main/java/org/apache/stanbol/enhancer/servicesapi/rdf/TechnicalClasses.java URL: http://svn.apache.org/viewvc/stanbol/trunk/enhancer/generic/servicesapi/src/main/java/org/apache/stanbol/enhancer/servicesapi/rdf/TechnicalClasses.java?rev=1744328&r1=1744327&r2=1744328&view=diff ============================================================================== --- stanbol/trunk/enhancer/generic/servicesapi/src/main/java/org/apache/stanbol/enhancer/servicesapi/rdf/TechnicalClasses.java (original) +++ stanbol/trunk/enhancer/generic/servicesapi/src/main/java/org/apache/stanbol/enhancer/servicesapi/rdf/TechnicalClasses.java Tue May 17 22:20:49 2016 @@ -20,7 +20,7 @@ import java.util.Collections; import java.util.HashMap; import java.util.Map; -import org.apache.clerezza.rdf.core.UriRef; +import org.apache.clerezza.commons.rdf.IRI; /** * Classes to be used as types for resources that are not real life entities but @@ -34,21 +34,21 @@ public final class TechnicalClasses { /** * Type used for all enhancement created by Stanbol Enhancer */ - public static final UriRef ENHANCER_ENHANCEMENT = new UriRef( + public static final IRI ENHANCER_ENHANCEMENT = new IRI( NamespaceEnum.fise+"Enhancement"); /** * Type used for annotations on Text created by Stanbol Enhancer. This type is intended * to be used in combination with ENHANCER_ENHANCEMENT */ - public static final UriRef ENHANCER_TEXTANNOTATION = new UriRef( + public static final IRI ENHANCER_TEXTANNOTATION = new IRI( NamespaceEnum.fise+"TextAnnotation"); /** * Type used for annotations of named entities. This type is intended * to be used in combination with ENHANCER_ENHANCEMENT */ - public static final UriRef ENHANCER_ENTITYANNOTATION = new UriRef( + public static final IRI ENHANCER_ENTITYANNOTATION = new IRI( NamespaceEnum.fise+"EntityAnnotation"); /** @@ -62,14 +62,14 @@ public final class TechnicalClasses { * The entity or concept is not necessarily explicitly mentioned * in the document (like a traditional entity occurrence would). */ - public static final UriRef ENHANCER_TOPICANNOTATION = new UriRef( + public static final IRI ENHANCER_TOPICANNOTATION = new IRI( NamespaceEnum.fise+"TopicAnnotation"); /** * To be used as a type pour any semantic knowledge extraction */ @Deprecated - public static final UriRef ENHANCER_EXTRACTION = new UriRef( + public static final IRI ENHANCER_EXTRACTION = new IRI( "http://iks-project.eu/ns/enhancer/extraction/Extraction"); /** @@ -79,13 +79,13 @@ public final class TechnicalClasses { * @deprecated */ @Deprecated - public static final UriRef ANNOTEA_ANNOTATION = new UriRef( + public static final IRI ANNOTEA_ANNOTATION = new IRI( "http://www.w3.org/2000/10/annotation-ns#Annotation"); /** * To be used to type the URI of the content item being annotated by Stanbol Enhancer */ - public static final UriRef FOAF_DOCUMENT = new UriRef( + public static final IRI FOAF_DOCUMENT = new IRI( NamespaceEnum.foaf + "Document"); /** @@ -96,7 +96,7 @@ public final class TechnicalClasses { * {@link OntologicalClasses#SKOS_CONCEPT} (see * <a href="https://issues.apache.org/jira/browse/STANBOL-617">STANBOL-617</a>) */ - public static final UriRef ENHANCER_CATEGORY = new UriRef( + public static final IRI ENHANCER_CATEGORY = new IRI( NamespaceEnum.fise + "Category"); /** @@ -107,13 +107,13 @@ public final class TechnicalClasses { * (see * <a href="https://issues.apache.org/jira/browse/STANBOL-613">STANBOL-613</a>) */ - public static final UriRef DCTERMS_LINGUISTIC_SYSTEM = new UriRef( + public static final IRI DCTERMS_LINGUISTIC_SYSTEM = new IRI( NamespaceEnum.dc + "LinguisticSystem"); /** * The confidence level of {@link #ENHANCER_ENHANCEMENT}s */ - public static final UriRef FNHANCER_CONFIDENCE_LEVEL = new UriRef( + public static final IRI FNHANCER_CONFIDENCE_LEVEL = new IRI( NamespaceEnum.fise + "ConfidenceLevel"); /** @@ -129,12 +129,12 @@ public final class TechnicalClasses { public static enum CONFIDENCE_LEVEL_ENUM{ certain,ambiguous,suggestion,uncertain; - private final UriRef uri; + private final IRI uri; private final String localName; private CONFIDENCE_LEVEL_ENUM() { localName = "cl-"+name(); - uri = new UriRef(NamespaceEnum.fise+localName); + uri = new IRI(NamespaceEnum.fise+localName); } public String getLocalName(){ @@ -145,14 +145,14 @@ public final class TechnicalClasses { return uri.toString(); }; - public UriRef getUri(){ + public IRI getUri(){ return uri; } - private static final Map<UriRef,CONFIDENCE_LEVEL_ENUM> uriRef2enum; + private static final Map<IRI,CONFIDENCE_LEVEL_ENUM> uriRef2enum; private static final Map<String,CONFIDENCE_LEVEL_ENUM> uri2enum; static { - Map<UriRef,CONFIDENCE_LEVEL_ENUM> ur = new HashMap<UriRef,TechnicalClasses.CONFIDENCE_LEVEL_ENUM>(); + Map<IRI,CONFIDENCE_LEVEL_ENUM> ur = new HashMap<IRI,TechnicalClasses.CONFIDENCE_LEVEL_ENUM>(); Map<String,CONFIDENCE_LEVEL_ENUM> us = new HashMap<String,TechnicalClasses.CONFIDENCE_LEVEL_ENUM>(); for(CONFIDENCE_LEVEL_ENUM cl : CONFIDENCE_LEVEL_ENUM.values()){ ur.put(cl.getUri(), cl); @@ -162,17 +162,17 @@ public final class TechnicalClasses { uri2enum = Collections.unmodifiableMap(us); } /** - * Getter for the fise:ConfidenceLevel instance for the {@link UriRef} + * Getter for the fise:ConfidenceLevel instance for the {@link IRI} * @param uri the URI * @return the fise:ConfidenceLevel instance or <code>null</code> if the * parsed URI is not one of the four defined instances */ - public static CONFIDENCE_LEVEL_ENUM getConfidenceLevel(UriRef uri){ + public static CONFIDENCE_LEVEL_ENUM getConfidenceLevel(IRI uri){ return uriRef2enum.get(uri); } /** - * Getter for the fise:ConfidenceLevel instance for the {@link UriRef} + * Getter for the fise:ConfidenceLevel instance for the {@link IRI} * @param uri the URI string * @return the fise:ConfidenceLevel instance or <code>null</code> if the * parsed URI is not one of the four defined instances Modified: stanbol/trunk/enhancer/generic/servicesapi/src/test/java/org/apache/stanbol/enhancer/serviceapi/helper/EnhancementEngineHelperTest.java URL: http://svn.apache.org/viewvc/stanbol/trunk/enhancer/generic/servicesapi/src/test/java/org/apache/stanbol/enhancer/serviceapi/helper/EnhancementEngineHelperTest.java?rev=1744328&r1=1744327&r2=1744328&view=diff ============================================================================== --- stanbol/trunk/enhancer/generic/servicesapi/src/test/java/org/apache/stanbol/enhancer/serviceapi/helper/EnhancementEngineHelperTest.java (original) +++ stanbol/trunk/enhancer/generic/servicesapi/src/test/java/org/apache/stanbol/enhancer/serviceapi/helper/EnhancementEngineHelperTest.java Tue May 17 22:20:49 2016 @@ -21,11 +21,11 @@ import java.util.Arrays; import java.util.Collection; import java.util.HashSet; -import org.apache.clerezza.rdf.core.Language; +import org.apache.clerezza.commons.rdf.Language; +import org.apache.clerezza.commons.rdf.Graph; +import org.apache.clerezza.commons.rdf.IRI; import org.apache.clerezza.rdf.core.LiteralFactory; -import org.apache.clerezza.rdf.core.MGraph; -import org.apache.clerezza.rdf.core.UriRef; -import org.apache.stanbol.commons.indexedgraph.IndexedMGraph; +import org.apache.stanbol.commons.indexedgraph.IndexedGraph; import org.apache.stanbol.enhancer.servicesapi.ContentItem; import org.apache.stanbol.enhancer.servicesapi.EngineException; import org.apache.stanbol.enhancer.servicesapi.EnhancementEngine; @@ -67,9 +67,9 @@ public class EnhancementEngineHelperTest Language lang = new Language("en"); int start = content.indexOf("Stanbol"); int end = start+"Stanbol Enhancer".length(); - UriRef ciUri = new UriRef("http://www.example.org/contentItem#1"); - MGraph metadata = new IndexedMGraph(); - UriRef ta = EnhancementEngineHelper.createTextEnhancement(metadata, dummyEngine, ciUri); + IRI ciUri = new IRI("http://www.example.org/contentItem#1"); + Graph metadata = new IndexedGraph(); + IRI ta = EnhancementEngineHelper.createTextEnhancement(metadata, dummyEngine, ciUri); EnhancementEngineHelper.setOccurrence(metadata, ta, content, start, end, lang, -1, true); Assert.assertEquals("The ", EnhancementEngineHelper.getString( metadata, ta,Properties.ENHANCER_SELECTION_PREFIX));
