Modified: stanbol/trunk/enhancement-engines/zemanta/src/main/java/org/apache/stanbol/enhancer/engines/zemanta/ZemantaOntologyEnum.java URL: http://svn.apache.org/viewvc/stanbol/trunk/enhancement-engines/zemanta/src/main/java/org/apache/stanbol/enhancer/engines/zemanta/ZemantaOntologyEnum.java?rev=1744328&r1=1744327&r2=1744328&view=diff ============================================================================== --- stanbol/trunk/enhancement-engines/zemanta/src/main/java/org/apache/stanbol/enhancer/engines/zemanta/ZemantaOntologyEnum.java (original) +++ stanbol/trunk/enhancement-engines/zemanta/src/main/java/org/apache/stanbol/enhancer/engines/zemanta/ZemantaOntologyEnum.java Tue May 17 22:20:49 2016 @@ -16,7 +16,7 @@ */ package org.apache.stanbol.enhancer.engines.zemanta; -import org.apache.clerezza.rdf.core.UriRef; +import org.apache.clerezza.commons.rdf.IRI; /** * Holds concepts, properties and instances found in the Zemanta ontology. @@ -51,7 +51,7 @@ public enum ZemantaOntologyEnum { Keyword, name, schema,; - UriRef uri; + IRI uri; /** * Creates n new entity of this Enum by using the parsed namespace and @@ -61,7 +61,7 @@ public enum ZemantaOntologyEnum { * @param local The local name or <code>null</code> to use the default */ ZemantaOntologyEnum(String ns, String local) { - uri = new UriRef((ns == null ? "http://s.zemanta.com/ns#" : ns) + (local == null ? name() : local)); + uri = new IRI((ns == null ? "http://s.zemanta.com/ns#" : ns) + (local == null ? name() : local)); } /** @@ -96,9 +96,9 @@ public enum ZemantaOntologyEnum { /** * The URI of the element of this Enum. * - * @return the URI of the element as Clerezza UriRef + * @return the URI of the element as Clerezza IRI */ - public UriRef getUri() { + public IRI getUri() { return uri; } }
Modified: stanbol/trunk/enhancement-engines/zemanta/src/main/java/org/apache/stanbol/enhancer/engines/zemanta/impl/ZemantaAPIWrapper.java URL: http://svn.apache.org/viewvc/stanbol/trunk/enhancement-engines/zemanta/src/main/java/org/apache/stanbol/enhancer/engines/zemanta/impl/ZemantaAPIWrapper.java?rev=1744328&r1=1744327&r2=1744328&view=diff ============================================================================== --- stanbol/trunk/enhancement-engines/zemanta/src/main/java/org/apache/stanbol/enhancer/engines/zemanta/impl/ZemantaAPIWrapper.java (original) +++ stanbol/trunk/enhancement-engines/zemanta/src/main/java/org/apache/stanbol/enhancer/engines/zemanta/impl/ZemantaAPIWrapper.java Tue May 17 22:20:49 2016 @@ -27,9 +27,9 @@ import java.net.URLEncoder; import java.util.EnumMap; import java.util.Map; -import org.apache.clerezza.rdf.core.Graph; -import org.apache.clerezza.rdf.core.MGraph; -import org.apache.clerezza.rdf.core.impl.SimpleMGraph; +import org.apache.clerezza.commons.rdf.ImmutableGraph; +import org.apache.clerezza.commons.rdf.Graph; +import org.apache.clerezza.commons.rdf.impl.utils.simple.SimpleGraph; import org.apache.clerezza.rdf.core.serializedform.SupportedFormat; import org.apache.clerezza.rdf.jena.parser.JenaParserProvider; import org.slf4j.Logger; @@ -38,7 +38,7 @@ import org.slf4j.LoggerFactory; /** * This class wraps the Zemanta API into one method. * Zemanta is able to return RDF-XML so parsing the response into - * a Graph object is simple. + * a ImmutableGraph object is simple. * * @author michaelmarth * @author westei (Rupert Westenthaler) @@ -55,9 +55,9 @@ public class ZemantaAPIWrapper { apiKey = key; } - public Graph enhance(String textToAnalyze) throws IOException { + public ImmutableGraph enhance(String textToAnalyze) throws IOException { InputStream is = sendRequest(textToAnalyze); - Graph zemantaResponseGraph = parseResponse(is); + ImmutableGraph zemantaResponseGraph = parseResponse(is); return zemantaResponseGraph; } @@ -130,13 +130,13 @@ public class ZemantaAPIWrapper { return data; } - private Graph parseResponse(InputStream is) { + private ImmutableGraph parseResponse(InputStream is) { JenaParserProvider jenaParserProvider = new JenaParserProvider(); //NOTE(rw): the new third parameter is the base URI used to resolve relative paths - MGraph g = new SimpleMGraph(); + Graph g = new SimpleGraph(); jenaParserProvider.parse(g,is, SupportedFormat.RDF_XML,null); log.debug("graph: " + g.toString()); - return g.getGraph(); + return g.getImmutableGraph(); } } Modified: stanbol/trunk/enhancement-engines/zemanta/src/main/java/org/apache/stanbol/enhancer/engines/zemanta/impl/ZemantaEnhancementEngine.java URL: http://svn.apache.org/viewvc/stanbol/trunk/enhancement-engines/zemanta/src/main/java/org/apache/stanbol/enhancer/engines/zemanta/impl/ZemantaEnhancementEngine.java?rev=1744328&r1=1744327&r2=1744328&view=diff ============================================================================== --- stanbol/trunk/enhancement-engines/zemanta/src/main/java/org/apache/stanbol/enhancer/engines/zemanta/impl/ZemantaEnhancementEngine.java (original) +++ stanbol/trunk/enhancement-engines/zemanta/src/main/java/org/apache/stanbol/enhancer/engines/zemanta/impl/ZemantaEnhancementEngine.java Tue May 17 22:20:49 2016 @@ -46,17 +46,17 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; -import org.apache.clerezza.rdf.core.Literal; +import org.apache.clerezza.commons.rdf.Literal; 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.PlainLiteral; -import org.apache.clerezza.rdf.core.Triple; -import org.apache.clerezza.rdf.core.TripleCollection; -import org.apache.clerezza.rdf.core.UriRef; -import org.apache.clerezza.rdf.core.impl.PlainLiteralImpl; -import org.apache.clerezza.rdf.core.impl.SimpleMGraph; -import org.apache.clerezza.rdf.core.impl.TripleImpl; +import org.apache.clerezza.commons.rdf.Graph; +import org.apache.clerezza.commons.rdf.BlankNodeOrIRI; + +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.simple.SimpleGraph; +import org.apache.clerezza.commons.rdf.impl.utils.TripleImpl; import org.apache.commons.io.IOUtils; import org.apache.felix.scr.annotations.Activate; import org.apache.felix.scr.annotations.Component; @@ -189,7 +189,7 @@ public class ZemantaEnhancementEngine public void computeEnhancements(ContentItem ci) throws EngineException { - Entry<UriRef,Blob> contentPart = ContentItemHelper.getBlob(ci, SUPPORTED_MIMETYPES); + Entry<IRI,Blob> contentPart = ContentItemHelper.getBlob(ci, SUPPORTED_MIMETYPES); if(contentPart == null){ throw new IllegalStateException("No ContentPart with a supported Mime Type" + "found for ContentItem "+ci.getUri()+"(supported: '" @@ -207,10 +207,10 @@ public class ZemantaEnhancementEngine contentPart.getKey(),ci.getUri()); return; } - MGraph graph = ci.getMetadata(); - UriRef ciId = ci.getUri(); + Graph graph = ci.getMetadata(); + IRI ciId = ci.getUri(); //we need to store the results of Zemanta in an temp graph - MGraph results = new SimpleMGraph(); + Graph results = new SimpleGraph(); ZemantaAPIWrapper zemanta = new ZemantaAPIWrapper(key); try { results.addAll(zemanta.enhance(text)); @@ -234,20 +234,20 @@ public class ZemantaEnhancementEngine (Object) defaultOrder)); } - protected void processCategories(MGraph results, MGraph enhancements, UriRef ciId) { + protected void processCategories(Graph results, Graph enhancements, IRI ciId) { Iterator<Triple> categories = results.filter(null, RDF_TYPE, ZemantaOntologyEnum.Category.getUri()); //add the root Text annotation as soon as the first TopicAnnotation is added. - UriRef textAnnotation = null; + IRI textAnnotation = null; while (categories.hasNext()) { - NonLiteral category = categories.next().getSubject(); + BlankNodeOrIRI category = categories.next().getSubject(); log.debug("process category " + category); Double confidence = parseConfidence(results, category); log.debug(" > confidence :" + confidence); //now we need to follow the Target link - UriRef target = EnhancementEngineHelper.getReference(results, category, ZemantaOntologyEnum.target.getUri()); + IRI target = EnhancementEngineHelper.getReference(results, category, ZemantaOntologyEnum.target.getUri()); if (target != null) { //first check the used categorisation - UriRef categorisationScheme = EnhancementEngineHelper.getReference(results, target, ZemantaOntologyEnum.categorization.getUri()); + IRI categorisationScheme = EnhancementEngineHelper.getReference(results, target, ZemantaOntologyEnum.categorization.getUri()); if (categorisationScheme != null && categorisationScheme.equals(ZemantaOntologyEnum.categorization_DMOZ.getUri())) { String categoryTitle = EnhancementEngineHelper.getString(results, target, ZemantaOntologyEnum.title.getUri()); if (categoryTitle != null) { @@ -258,7 +258,7 @@ public class ZemantaEnhancementEngine enhancements.add(new TripleImpl(textAnnotation,DC_TYPE,SKOS_CONCEPT)); } //now write the TopicAnnotation - UriRef categoryEnhancement = createTopicEnhancement(enhancements, this, ciId); + IRI categoryEnhancement = createTopicEnhancement(enhancements, this, ciId); //make related to the EntityAnnotation enhancements.add(new TripleImpl(categoryEnhancement, DC_RELATION, textAnnotation)); //write the title @@ -266,7 +266,7 @@ public class ZemantaEnhancementEngine //write the reference if (categoryTitle.startsWith(ZEMANTA_DMOZ_PREFIX)) { enhancements.add( - new TripleImpl(categoryEnhancement, ENHANCER_ENTITY_REFERENCE, new UriRef(DMOZ_BASE_URL + categoryTitle.substring(ZEMANTA_DMOZ_PREFIX.length())))); + new TripleImpl(categoryEnhancement, ENHANCER_ENTITY_REFERENCE, new IRI(DMOZ_BASE_URL + categoryTitle.substring(ZEMANTA_DMOZ_PREFIX.length())))); } //write the confidence if (confidence != null) { @@ -302,40 +302,40 @@ public class ZemantaEnhancementEngine * enhancements * @param text the content of the content item as string */ - protected void processRecognition(MGraph results, MGraph enhancements, String text, UriRef ciId) { + protected void processRecognition(Graph results, Graph enhancements, String text, IRI ciId) { Iterator<Triple> recognitions = results.filter(null, RDF_TYPE, ZemantaOntologyEnum.Recognition.getUri()); while (recognitions.hasNext()) { - NonLiteral recognition = recognitions.next().getSubject(); + BlankNodeOrIRI recognition = recognitions.next().getSubject(); log.debug("process recognition " + recognition); //first get everything we need for the textAnnotations Double confidence = parseConfidence(results, recognition); log.debug(" > confidence :" + confidence); String anchor = EnhancementEngineHelper.getString(results, recognition, ZemantaOntologyEnum.anchor.getUri()); log.debug(" > anchor :" + anchor); - Collection<NonLiteral> textAnnotations = processTextAnnotation(enhancements, text, ciId, anchor, confidence); + Collection<BlankNodeOrIRI> textAnnotations = processTextAnnotation(enhancements, text, ciId, anchor, confidence); log.debug(" > number of textAnnotations :" + textAnnotations.size()); //second we need to create the EntityAnnotation that represent the //recognition - NonLiteral object = EnhancementEngineHelper.getReference(results, recognition, ZemantaOntologyEnum.object.getUri()); + BlankNodeOrIRI object = EnhancementEngineHelper.getReference(results, recognition, ZemantaOntologyEnum.object.getUri()); log.debug(" > object :" + object); //The targets represent the linked entities // ... and yes there can be more of them! //TODO: can we create an EntityAnnotation with several referred entities? // Should we use the owl:sameAs to decide that! - Set<UriRef> sameAsSet = new HashSet<UriRef>(); - for (Iterator<UriRef> sameAs = getReferences(results, object, ZemantaOntologyEnum.owlSameAs.getUri()); sameAs.hasNext(); sameAsSet.add(sameAs.next())) + Set<IRI> sameAsSet = new HashSet<IRI>(); + for (Iterator<IRI> sameAs = getReferences(results, object, ZemantaOntologyEnum.owlSameAs.getUri()); sameAs.hasNext(); sameAsSet.add(sameAs.next())) ; log.debug(" > sameAs :" + sameAsSet); //now parse the targets and look if there are others than the one //merged by using sameAs - Iterator<UriRef> targets = EnhancementEngineHelper.getReferences(results, object, ZemantaOntologyEnum.target.getUri()); + Iterator<IRI> targets = EnhancementEngineHelper.getReferences(results, object, ZemantaOntologyEnum.target.getUri()); String title = null; while (targets.hasNext()) { //the entityRef is the URL of the target - UriRef entity = targets.next(); + IRI entity = targets.next(); log.debug(" - target :" + entity); - UriRef targetType = EnhancementEngineHelper.getReference(results, entity, ZemantaOntologyEnum.targetType.getUri()); + IRI targetType = EnhancementEngineHelper.getReference(results, entity, ZemantaOntologyEnum.targetType.getUri()); log.debug(" o type :" + targetType); if (ZemantaOntologyEnum.targetType_RDF.getUri().equals(targetType)) { String targetTitle = EnhancementEngineHelper.getString(results, entity, ZemantaOntologyEnum.title.getUri()); @@ -357,16 +357,16 @@ public class ZemantaEnhancementEngine // any entity types! } //create the entityEnhancement - UriRef entityEnhancement = EnhancementEngineHelper.createEntityEnhancement(enhancements, this, ciId); + IRI entityEnhancement = EnhancementEngineHelper.createEntityEnhancement(enhancements, this, ciId); if (confidence != null) { enhancements.add( new TripleImpl(entityEnhancement, ENHANCER_CONFIDENCE, literalFactory.createTypedLiteral(confidence))); } - for (NonLiteral relatedTextAnnotation : textAnnotations) { + for (BlankNodeOrIRI relatedTextAnnotation : textAnnotations) { enhancements.add( new TripleImpl(entityEnhancement, DC_RELATION, relatedTextAnnotation)); } - for (UriRef entity : sameAsSet) { + for (IRI entity : sameAsSet) { enhancements.add( new TripleImpl(entityEnhancement, ENHANCER_ENTITY_REFERENCE, entity)); } @@ -388,7 +388,7 @@ public class ZemantaEnhancementEngine * double value. * @see ZemantaOntologyEnum#confidence */ - private static Double parseConfidence(TripleCollection tc, NonLiteral resource) { + private static Double parseConfidence(Graph tc, BlankNodeOrIRI resource) { String confidenceString = EnhancementEngineHelper.getString(tc, resource, ZemantaOntologyEnum.confidence.getUri()); Double confidence; if (confidenceString != null) { @@ -421,21 +421,21 @@ public class ZemantaEnhancementEngine * * @return a collection of all existing/created text annotations for the parsed anchor */ - private Collection<NonLiteral> processTextAnnotation(MGraph enhancements, String text, UriRef ciId, String anchor, Double confidence) { - Collection<NonLiteral> textAnnotations = new ArrayList<NonLiteral>(); + private Collection<BlankNodeOrIRI> processTextAnnotation(Graph enhancements, String text, IRI ciId, String anchor, Double confidence) { + Collection<BlankNodeOrIRI> textAnnotations = new ArrayList<BlankNodeOrIRI>(); int anchorLength = anchor.length(); Literal anchorLiteral = new PlainLiteralImpl(anchor); //first search for existing TextAnnotations for the anchor - Map<Integer, Collection<NonLiteral>> existingTextAnnotationsMap = searchExistingTextAnnotations(enhancements, anchorLiteral); + Map<Integer, Collection<BlankNodeOrIRI>> existingTextAnnotationsMap = searchExistingTextAnnotations(enhancements, anchorLiteral); for (int current = text.indexOf(anchor); current >= 0; current = text.indexOf(anchor, current + 1)) { - Collection<NonLiteral> existingTextAnnotations = existingTextAnnotationsMap.get(current); + Collection<BlankNodeOrIRI> existingTextAnnotations = existingTextAnnotationsMap.get(current); if (existingTextAnnotations != null) { //use the existing once textAnnotations.addAll(existingTextAnnotations); } else { //we need to create an new one! - UriRef textAnnotation = EnhancementEngineHelper.createTextEnhancement(enhancements, this, ciId); + IRI textAnnotation = EnhancementEngineHelper.createTextEnhancement(enhancements, this, ciId); textAnnotations.add(textAnnotation); //write the selection enhancements.add( @@ -490,18 +490,18 @@ public class ZemantaEnhancementEngine * @return Map that uses the start position as an key and a list of * text annotations as an value. */ - private Map<Integer, Collection<NonLiteral>> searchExistingTextAnnotations(MGraph enhancements, Literal anchorLiteral) { + private Map<Integer, Collection<BlankNodeOrIRI>> searchExistingTextAnnotations(Graph enhancements, Literal anchorLiteral) { Iterator<Triple> textAnnotationsIterator = enhancements.filter(null, ENHANCER_SELECTED_TEXT, anchorLiteral); - Map<Integer, Collection<NonLiteral>> existingTextAnnotationsMap = new HashMap<Integer, Collection<NonLiteral>>(); + Map<Integer, Collection<BlankNodeOrIRI>> existingTextAnnotationsMap = new HashMap<Integer, Collection<BlankNodeOrIRI>>(); while (textAnnotationsIterator.hasNext()) { - NonLiteral subject = textAnnotationsIterator.next().getSubject(); + BlankNodeOrIRI subject = textAnnotationsIterator.next().getSubject(); //test rdfType if (enhancements.contains(new TripleImpl(subject, RDF_TYPE, ENHANCER_TEXTANNOTATION))) { Integer start = EnhancementEngineHelper.get(enhancements, subject, ENHANCER_START, Integer.class, literalFactory); if (start != null) { - Collection<NonLiteral> textAnnotationList = existingTextAnnotationsMap.get(start); + Collection<BlankNodeOrIRI> textAnnotationList = existingTextAnnotationsMap.get(start); if (textAnnotationList == null) { - textAnnotationList = new ArrayList<NonLiteral>(); + textAnnotationList = new ArrayList<BlankNodeOrIRI>(); existingTextAnnotationsMap.put(start, textAnnotationList); } textAnnotationList.add(subject); Modified: stanbol/trunk/enhancement-engines/zemanta/src/test/java/org/apache/stanbol/enhancer/engines/zemanta/impl/ZemantaEnhancementEngineTest.java URL: http://svn.apache.org/viewvc/stanbol/trunk/enhancement-engines/zemanta/src/test/java/org/apache/stanbol/enhancer/engines/zemanta/impl/ZemantaEnhancementEngineTest.java?rev=1744328&r1=1744327&r2=1744328&view=diff ============================================================================== --- stanbol/trunk/enhancement-engines/zemanta/src/test/java/org/apache/stanbol/enhancer/engines/zemanta/impl/ZemantaEnhancementEngineTest.java (original) +++ stanbol/trunk/enhancement-engines/zemanta/src/test/java/org/apache/stanbol/enhancer/engines/zemanta/impl/ZemantaEnhancementEngineTest.java Tue May 17 22:20:49 2016 @@ -28,8 +28,8 @@ import java.util.Hashtable; import java.util.Map; import org.apache.clerezza.rdf.core.LiteralFactory; -import org.apache.clerezza.rdf.core.Resource; -import org.apache.clerezza.rdf.core.UriRef; +import org.apache.clerezza.commons.rdf.RDFTerm; +import org.apache.clerezza.commons.rdf.IRI; import org.apache.clerezza.rdf.jena.serializer.JenaSerializerProvider; import org.apache.stanbol.enhancer.contentitem.inmemory.InMemoryContentItemFactory; import org.apache.stanbol.enhancer.servicesapi.ContentItem; @@ -95,7 +95,7 @@ public class ZemantaEnhancementEngineTes public static ContentItem wrapAsContentItem(final String text) throws IOException { String id = "urn:org.apache.stanbol.enhancer:test:engines.zemanta:content-item-" + EnhancementEngineHelper.randomUUID().toString(); - return ciFactory.createContentItem(new UriRef(id), new StringSource(text)); + return ciFactory.createContentItem(new IRI(id), new StringSource(text)); } @Test @@ -109,7 +109,7 @@ public class ZemantaEnhancementEngineTes } JenaSerializerProvider serializer = new JenaSerializerProvider(); serializer.serialize(System.out, ci.getMetadata(), TURTLE); - Map<UriRef,Resource> expectedValues = new HashMap<UriRef,Resource>(); + Map<IRI,RDFTerm> expectedValues = new HashMap<IRI,RDFTerm>(); expectedValues.put(Properties.ENHANCER_EXTRACTED_FROM, ci.getUri()); expectedValues.put(Properties.DC_CREATOR, LiteralFactory.getInstance().createTypedLiteral( zemantaEngine.getClass().getName())); Modified: stanbol/trunk/enhancer/benchmark/src/main/java/org/apache/stanbol/enhancer/benchmark/Benchmark.java URL: http://svn.apache.org/viewvc/stanbol/trunk/enhancer/benchmark/src/main/java/org/apache/stanbol/enhancer/benchmark/Benchmark.java?rev=1744328&r1=1744327&r2=1744328&view=diff ============================================================================== --- stanbol/trunk/enhancer/benchmark/src/main/java/org/apache/stanbol/enhancer/benchmark/Benchmark.java (original) +++ stanbol/trunk/enhancer/benchmark/src/main/java/org/apache/stanbol/enhancer/benchmark/Benchmark.java Tue May 17 22:20:49 2016 @@ -18,7 +18,7 @@ package org.apache.stanbol.enhancer.benc import java.util.List; -import org.apache.clerezza.rdf.core.Graph; +import org.apache.clerezza.commons.rdf.ImmutableGraph; import org.apache.stanbol.enhancer.servicesapi.Chain; import org.apache.stanbol.enhancer.servicesapi.ContentItemFactory; import org.apache.stanbol.enhancer.servicesapi.EnhancementException; @@ -40,8 +40,8 @@ public interface Benchmark extends List< List<BenchmarkResult> execute(EnhancementJobManager jobManager, ContentItemFactory ciFactory) throws EnhancementException; - /** Return the enhanced Graph of our input text */ - Graph getGraph(EnhancementJobManager jobManager, + /** Return the enhanced ImmutableGraph of our input text */ + ImmutableGraph getGraph(EnhancementJobManager jobManager, ContentItemFactory ciFactory) throws EnhancementException; /** Modified: stanbol/trunk/enhancer/benchmark/src/main/java/org/apache/stanbol/enhancer/benchmark/BenchmarkResult.java URL: http://svn.apache.org/viewvc/stanbol/trunk/enhancer/benchmark/src/main/java/org/apache/stanbol/enhancer/benchmark/BenchmarkResult.java?rev=1744328&r1=1744327&r2=1744328&view=diff ============================================================================== --- stanbol/trunk/enhancer/benchmark/src/main/java/org/apache/stanbol/enhancer/benchmark/BenchmarkResult.java (original) +++ stanbol/trunk/enhancer/benchmark/src/main/java/org/apache/stanbol/enhancer/benchmark/BenchmarkResult.java Tue May 17 22:20:49 2016 @@ -18,8 +18,8 @@ package org.apache.stanbol.enhancer.benc import java.util.Set; -import org.apache.clerezza.rdf.core.Graph; -import org.apache.clerezza.rdf.core.UriRef; +import org.apache.clerezza.commons.rdf.ImmutableGraph; +import org.apache.clerezza.commons.rdf.IRI; /** Benchmark result for a single TripleMatcherGroup */ public interface BenchmarkResult { @@ -33,5 +33,5 @@ public interface BenchmarkResult { String getInfo(); /** Set of subjects that match our TripleMatcherGroup */ - Set<UriRef> getMatchingSubjects(); + Set<IRI> getMatchingSubjects(); } Modified: stanbol/trunk/enhancer/benchmark/src/main/java/org/apache/stanbol/enhancer/benchmark/TripleMatcher.java URL: http://svn.apache.org/viewvc/stanbol/trunk/enhancer/benchmark/src/main/java/org/apache/stanbol/enhancer/benchmark/TripleMatcher.java?rev=1744328&r1=1744327&r2=1744328&view=diff ============================================================================== --- stanbol/trunk/enhancer/benchmark/src/main/java/org/apache/stanbol/enhancer/benchmark/TripleMatcher.java (original) +++ stanbol/trunk/enhancer/benchmark/src/main/java/org/apache/stanbol/enhancer/benchmark/TripleMatcher.java Tue May 17 22:20:49 2016 @@ -16,7 +16,7 @@ */ package org.apache.stanbol.enhancer.benchmark; -import org.apache.clerezza.rdf.core.Triple; +import org.apache.clerezza.commons.rdf.Triple; /** TripleMatcher is used to count how many Triples * match a given statement in the benchmark tool. Modified: stanbol/trunk/enhancer/benchmark/src/main/java/org/apache/stanbol/enhancer/benchmark/TripleMatcherGroup.java URL: http://svn.apache.org/viewvc/stanbol/trunk/enhancer/benchmark/src/main/java/org/apache/stanbol/enhancer/benchmark/TripleMatcherGroup.java?rev=1744328&r1=1744327&r2=1744328&view=diff ============================================================================== --- stanbol/trunk/enhancer/benchmark/src/main/java/org/apache/stanbol/enhancer/benchmark/TripleMatcherGroup.java (original) +++ stanbol/trunk/enhancer/benchmark/src/main/java/org/apache/stanbol/enhancer/benchmark/TripleMatcherGroup.java Tue May 17 22:20:49 2016 @@ -19,8 +19,8 @@ package org.apache.stanbol.enhancer.benc import java.util.Collection; import java.util.Set; -import org.apache.clerezza.rdf.core.Graph; -import org.apache.clerezza.rdf.core.UriRef; +import org.apache.clerezza.commons.rdf.ImmutableGraph; +import org.apache.clerezza.commons.rdf.IRI; /** A group of TripleMatcher, used to check that * enhancements match all the TripleMatcher in @@ -36,10 +36,10 @@ public interface TripleMatcherGroup { */ boolean isExpectGroup(); - /** Return the set of UriRef that match all - * TripleMatcher in this group for supplied Graph + /** Return the set of IRI that match all + * TripleMatcher in this group for supplied ImmutableGraph */ - Set<UriRef> getMatchingSubjects(Graph g); + Set<IRI> getMatchingSubjects(ImmutableGraph g); /** @return our TripleMatcher */ Collection<TripleMatcher> getMatchers(); Modified: stanbol/trunk/enhancer/benchmark/src/main/java/org/apache/stanbol/enhancer/benchmark/impl/BenchmarkImpl.java URL: http://svn.apache.org/viewvc/stanbol/trunk/enhancer/benchmark/src/main/java/org/apache/stanbol/enhancer/benchmark/impl/BenchmarkImpl.java?rev=1744328&r1=1744327&r2=1744328&view=diff ============================================================================== --- stanbol/trunk/enhancer/benchmark/src/main/java/org/apache/stanbol/enhancer/benchmark/impl/BenchmarkImpl.java (original) +++ stanbol/trunk/enhancer/benchmark/src/main/java/org/apache/stanbol/enhancer/benchmark/impl/BenchmarkImpl.java Tue May 17 22:20:49 2016 @@ -20,7 +20,7 @@ import java.io.IOException; import java.util.LinkedList; import java.util.List; -import org.apache.clerezza.rdf.core.Graph; +import org.apache.clerezza.commons.rdf.ImmutableGraph; import org.apache.stanbol.enhancer.benchmark.Benchmark; import org.apache.stanbol.enhancer.benchmark.BenchmarkResult; import org.apache.stanbol.enhancer.benchmark.TripleMatcherGroup; @@ -36,7 +36,7 @@ public class BenchmarkImpl extends Linke private String name; private String inputText; - private Graph graph; + private ImmutableGraph graph; private ContentItemFactory ciFactory; private Chain chain; @@ -94,7 +94,7 @@ public class BenchmarkImpl extends Linke } /** @inheritDoc */ - public Graph getGraph(EnhancementJobManager jobManager, + public ImmutableGraph getGraph(EnhancementJobManager jobManager, ContentItemFactory ciFactory) throws EnhancementException { if(graph == null) { ContentItem ci; @@ -109,7 +109,7 @@ public class BenchmarkImpl extends Linke } else { //parsing null as chain does not work! jobManager.enhanceContent(ci,chain); } - graph = ci.getMetadata().getGraph(); + graph = ci.getMetadata().getImmutableGraph(); } return graph; } Modified: stanbol/trunk/enhancer/benchmark/src/main/java/org/apache/stanbol/enhancer/benchmark/impl/BenchmarkResultImpl.java URL: http://svn.apache.org/viewvc/stanbol/trunk/enhancer/benchmark/src/main/java/org/apache/stanbol/enhancer/benchmark/impl/BenchmarkResultImpl.java?rev=1744328&r1=1744327&r2=1744328&view=diff ============================================================================== --- stanbol/trunk/enhancer/benchmark/src/main/java/org/apache/stanbol/enhancer/benchmark/impl/BenchmarkResultImpl.java (original) +++ stanbol/trunk/enhancer/benchmark/src/main/java/org/apache/stanbol/enhancer/benchmark/impl/BenchmarkResultImpl.java Tue May 17 22:20:49 2016 @@ -18,8 +18,8 @@ package org.apache.stanbol.enhancer.benc import java.util.Set; -import org.apache.clerezza.rdf.core.Graph; -import org.apache.clerezza.rdf.core.UriRef; +import org.apache.clerezza.commons.rdf.ImmutableGraph; +import org.apache.clerezza.commons.rdf.IRI; import org.apache.stanbol.enhancer.benchmark.BenchmarkResult; import org.apache.stanbol.enhancer.benchmark.TripleMatcherGroup; @@ -28,9 +28,9 @@ public class BenchmarkResultImpl impleme private final TripleMatcherGroup tmg; private final boolean successful; private String info; - private final Set<UriRef> matchingSubjects; + private final Set<IRI> matchingSubjects; - BenchmarkResultImpl(TripleMatcherGroup tmg, Graph graph) { + BenchmarkResultImpl(TripleMatcherGroup tmg, ImmutableGraph graph) { this.tmg = tmg; matchingSubjects = tmg.getMatchingSubjects(graph); @@ -82,7 +82,7 @@ public class BenchmarkResultImpl impleme } @Override - public Set<UriRef> getMatchingSubjects() { + public Set<IRI> getMatchingSubjects() { return matchingSubjects; } } Modified: stanbol/trunk/enhancer/benchmark/src/main/java/org/apache/stanbol/enhancer/benchmark/impl/BenchmarkServlet.java URL: http://svn.apache.org/viewvc/stanbol/trunk/enhancer/benchmark/src/main/java/org/apache/stanbol/enhancer/benchmark/impl/BenchmarkServlet.java?rev=1744328&r1=1744327&r2=1744328&view=diff ============================================================================== --- stanbol/trunk/enhancer/benchmark/src/main/java/org/apache/stanbol/enhancer/benchmark/impl/BenchmarkServlet.java (original) +++ stanbol/trunk/enhancer/benchmark/src/main/java/org/apache/stanbol/enhancer/benchmark/impl/BenchmarkServlet.java Tue May 17 22:20:49 2016 @@ -35,7 +35,7 @@ import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -import org.apache.clerezza.rdf.core.Graph; +import org.apache.clerezza.commons.rdf.ImmutableGraph; import org.apache.clerezza.rdf.core.serializedform.Serializer; import org.apache.commons.io.IOUtils; import org.apache.commons.io.LineIterator; @@ -108,7 +108,7 @@ public class BenchmarkServlet extends Ht serializer = s; } - public String format(Graph g, String mimeType) throws UnsupportedEncodingException { + public String format(ImmutableGraph g, String mimeType) throws UnsupportedEncodingException { final ByteArrayOutputStream bos = new ByteArrayOutputStream(); serializer.serialize(bos, g, mimeType); return bos.toString("UTF-8"); @@ -128,7 +128,7 @@ public class BenchmarkServlet extends Ht log.info("Servlet mounted at {}", mountPath); final Properties config = new Properties(); - config.put("class.resource.loader.description", "Velocity Classpath Resource Loader"); + config.put("class.resource.loader.description", "Velocity Classpath RDFTerm Loader"); config.put("class.resource.loader.class", "org.apache.velocity.runtime.resource.loader.ClasspathResourceLoader"); config.put("resource.loader","class"); velocity.init(config); Modified: stanbol/trunk/enhancer/benchmark/src/main/java/org/apache/stanbol/enhancer/benchmark/impl/TripleMatcherGroupImpl.java URL: http://svn.apache.org/viewvc/stanbol/trunk/enhancer/benchmark/src/main/java/org/apache/stanbol/enhancer/benchmark/impl/TripleMatcherGroupImpl.java?rev=1744328&r1=1744327&r2=1744328&view=diff ============================================================================== --- stanbol/trunk/enhancer/benchmark/src/main/java/org/apache/stanbol/enhancer/benchmark/impl/TripleMatcherGroupImpl.java (original) +++ stanbol/trunk/enhancer/benchmark/src/main/java/org/apache/stanbol/enhancer/benchmark/impl/TripleMatcherGroupImpl.java Tue May 17 22:20:49 2016 @@ -23,10 +23,10 @@ import java.util.Iterator; import java.util.List; import java.util.Set; -import org.apache.clerezza.rdf.core.Graph; -import org.apache.clerezza.rdf.core.NonLiteral; -import org.apache.clerezza.rdf.core.Triple; -import org.apache.clerezza.rdf.core.UriRef; +import org.apache.clerezza.commons.rdf.ImmutableGraph; +import org.apache.clerezza.commons.rdf.BlankNodeOrIRI; +import org.apache.clerezza.commons.rdf.Triple; +import org.apache.clerezza.commons.rdf.IRI; import org.apache.stanbol.enhancer.benchmark.TripleMatcher; import org.apache.stanbol.enhancer.benchmark.TripleMatcherGroup; @@ -61,25 +61,25 @@ public class TripleMatcherGroupImpl impl } @Override - public Set<UriRef> getMatchingSubjects(Graph g) { + public Set<IRI> getMatchingSubjects(ImmutableGraph g) { if(matchers.isEmpty()) { - return new HashSet<UriRef>(); + return new HashSet<IRI>(); } // For all matchers, find the set of subjects that match // and compute the intersection of those sets - Set<UriRef> intersection = null; + Set<IRI> intersection = null; for(TripleMatcher m : matchers) { - final Set<UriRef> s = new HashSet<UriRef>(); + final Set<IRI> s = new HashSet<IRI>(); final Iterator<Triple> it = g.iterator(); while(it.hasNext()) { final Triple t = it.next(); if(m.matches(t)) { - final NonLiteral n = t.getSubject(); - if(n instanceof UriRef) { - s.add((UriRef)n); + final BlankNodeOrIRI n = t.getSubject(); + if(n instanceof IRI) { + s.add((IRI)n); } else { - // TODO do we need to handle non-UriRef subjects? + // TODO do we need to handle non-IRI subjects? } } } Modified: stanbol/trunk/enhancer/benchmark/src/main/java/org/apache/stanbol/enhancer/benchmark/impl/TripleMatcherImpl.java URL: http://svn.apache.org/viewvc/stanbol/trunk/enhancer/benchmark/src/main/java/org/apache/stanbol/enhancer/benchmark/impl/TripleMatcherImpl.java?rev=1744328&r1=1744327&r2=1744328&view=diff ============================================================================== --- stanbol/trunk/enhancer/benchmark/src/main/java/org/apache/stanbol/enhancer/benchmark/impl/TripleMatcherImpl.java (original) +++ stanbol/trunk/enhancer/benchmark/src/main/java/org/apache/stanbol/enhancer/benchmark/impl/TripleMatcherImpl.java Tue May 17 22:20:49 2016 @@ -18,15 +18,15 @@ package org.apache.stanbol.enhancer.benc import java.io.IOException; -import org.apache.clerezza.rdf.core.Triple; -import org.apache.clerezza.rdf.core.UriRef; +import org.apache.clerezza.commons.rdf.Triple; +import org.apache.clerezza.commons.rdf.IRI; import org.apache.stanbol.enhancer.benchmark.TripleMatcher; class TripleMatcherImpl implements TripleMatcher { private final String operator; - private final UriRef predicateUri; - private final UriRef objectUri; + private final IRI predicateUri; + private final IRI objectUri; /** Build from a line supplied by the parser. * Format is PREDICATE_URI OPERATOR ARGUMENTS, @@ -37,11 +37,11 @@ class TripleMatcherImpl implements Tripl throw new IOException("Invalid TripleMatcher format in line [" + line + "]"); } - predicateUri = new UriRef(parts[0]); + predicateUri = new IRI(parts[0]); operator = parts[1]; if("URI".equals(operator)) { - objectUri = new UriRef(parts[2]); + objectUri = new IRI(parts[2]); } else { // TODO support other operators objectUri = null; Modified: stanbol/trunk/enhancer/benchmark/src/test/java/org/apache/stanbol/enhancer/benchmark/impl/TripleMatcherGroupImplTest.java URL: http://svn.apache.org/viewvc/stanbol/trunk/enhancer/benchmark/src/test/java/org/apache/stanbol/enhancer/benchmark/impl/TripleMatcherGroupImplTest.java?rev=1744328&r1=1744327&r2=1744328&view=diff ============================================================================== --- stanbol/trunk/enhancer/benchmark/src/test/java/org/apache/stanbol/enhancer/benchmark/impl/TripleMatcherGroupImplTest.java (original) +++ stanbol/trunk/enhancer/benchmark/src/test/java/org/apache/stanbol/enhancer/benchmark/impl/TripleMatcherGroupImplTest.java Tue May 17 22:20:49 2016 @@ -20,20 +20,20 @@ import static org.junit.Assert.assertTru import java.util.Set; -import org.apache.clerezza.rdf.core.MGraph; -import org.apache.clerezza.rdf.core.UriRef; -import org.apache.clerezza.rdf.core.impl.SimpleMGraph; +import org.apache.clerezza.commons.rdf.Graph; +import org.apache.clerezza.commons.rdf.IRI; +import org.apache.clerezza.commons.rdf.impl.utils.simple.SimpleGraph; import org.junit.Before; import org.junit.Test; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertNotNull; public class TripleMatcherGroupImplTest { - private MGraph graph; + private Graph graph; @Before public void createGraph() { - graph = new SimpleMGraph(); + graph = new SimpleGraph(); graph.add(TripleUtil.uriTriple("S1", "P1", "01")); graph.add(TripleUtil.uriTriple("S1", "P1", "02")); graph.add(TripleUtil.uriTriple("S2", "P1", "01")); @@ -49,14 +49,14 @@ public class TripleMatcherGroupImplTest assertEquals( "Empty matcher group should find nothing", 0, - group.getMatchingSubjects(graph.getGraph()).size()); + group.getMatchingSubjects(graph.getImmutableGraph()).size()); // Add two matchers, only S1 and S2 match all of them group.addMatcher(new TripleMatcherImpl("P1 URI 01")); group.addMatcher(new TripleMatcherImpl("P1 URI 02")); - final Set<UriRef> actual = group.getMatchingSubjects(graph.getGraph()); - final Set<UriRef> expected = TripleUtil.uriRefSet("S1", "S2"); + final Set<IRI> actual = group.getMatchingSubjects(graph.getImmutableGraph()); + final Set<IRI> expected = TripleUtil.uriRefSet("S1", "S2"); assertEquals("Size of results " + actual + " matches " + expected, expected.size(), actual.size()); assertTrue("Content of results " + actual + " matches " + expected, expected.containsAll(actual)); Modified: stanbol/trunk/enhancer/benchmark/src/test/java/org/apache/stanbol/enhancer/benchmark/impl/TripleUtil.java URL: http://svn.apache.org/viewvc/stanbol/trunk/enhancer/benchmark/src/test/java/org/apache/stanbol/enhancer/benchmark/impl/TripleUtil.java?rev=1744328&r1=1744327&r2=1744328&view=diff ============================================================================== --- stanbol/trunk/enhancer/benchmark/src/test/java/org/apache/stanbol/enhancer/benchmark/impl/TripleUtil.java (original) +++ stanbol/trunk/enhancer/benchmark/src/test/java/org/apache/stanbol/enhancer/benchmark/impl/TripleUtil.java Tue May 17 22:20:49 2016 @@ -19,19 +19,19 @@ package org.apache.stanbol.enhancer.benc import java.util.HashSet; import java.util.Set; -import org.apache.clerezza.rdf.core.Triple; -import org.apache.clerezza.rdf.core.UriRef; -import org.apache.clerezza.rdf.core.impl.TripleImpl; +import org.apache.clerezza.commons.rdf.Triple; +import org.apache.clerezza.commons.rdf.IRI; +import org.apache.clerezza.commons.rdf.impl.utils.TripleImpl; public class TripleUtil { static Triple uriTriple(String subject, String predicate, String object) { - return new TripleImpl(new UriRef(subject), new UriRef(predicate), new UriRef(object)); + return new TripleImpl(new IRI(subject), new IRI(predicate), new IRI(object)); } - static Set<UriRef> uriRefSet(String...uri) { - final Set<UriRef> result = new HashSet<UriRef>(); + static Set<IRI> uriRefSet(String...uri) { + final Set<IRI> result = new HashSet<IRI>(); for(String str : uri) { - result.add(new UriRef(str)); + result.add(new IRI(str)); } return result; } Modified: stanbol/trunk/enhancer/chain/allactive/src/main/java/org/apache/stanbol/enhancer/chain/allactive/impl/AllActiveEnginesChain.java URL: http://svn.apache.org/viewvc/stanbol/trunk/enhancer/chain/allactive/src/main/java/org/apache/stanbol/enhancer/chain/allactive/impl/AllActiveEnginesChain.java?rev=1744328&r1=1744327&r2=1744328&view=diff ============================================================================== --- stanbol/trunk/enhancer/chain/allactive/src/main/java/org/apache/stanbol/enhancer/chain/allactive/impl/AllActiveEnginesChain.java (original) +++ stanbol/trunk/enhancer/chain/allactive/src/main/java/org/apache/stanbol/enhancer/chain/allactive/impl/AllActiveEnginesChain.java Tue May 17 22:20:49 2016 @@ -25,7 +25,7 @@ import java.util.Iterator; import java.util.List; import java.util.Set; -import org.apache.clerezza.rdf.core.Graph; +import org.apache.clerezza.commons.rdf.ImmutableGraph; import org.apache.stanbol.enhancer.servicesapi.Chain; import org.apache.stanbol.enhancer.servicesapi.ChainException; import org.apache.stanbol.enhancer.servicesapi.ContentItem; @@ -62,7 +62,7 @@ public class AllActiveEnginesChain imple private String name; private final Object lock = new Object(); private BundleContext context; - private Graph executionPlan; + private ImmutableGraph executionPlan; private Set<String> engineNames; private EnginesTracker tracker; @@ -107,7 +107,7 @@ public class AllActiveEnginesChain imple return name; } @Override - public Graph getExecutionPlan() throws ChainException { + public ImmutableGraph getExecutionPlan() throws ChainException { synchronized (lock) { if(executionPlan == null){ update(); Modified: stanbol/trunk/enhancer/chain/graph/src/main/java/org/apache/stanbol/enhancer/chain/graph/impl/GraphChain.java URL: http://svn.apache.org/viewvc/stanbol/trunk/enhancer/chain/graph/src/main/java/org/apache/stanbol/enhancer/chain/graph/impl/GraphChain.java?rev=1744328&r1=1744327&r2=1744328&view=diff ============================================================================== --- stanbol/trunk/enhancer/chain/graph/src/main/java/org/apache/stanbol/enhancer/chain/graph/impl/GraphChain.java (original) +++ stanbol/trunk/enhancer/chain/graph/src/main/java/org/apache/stanbol/enhancer/chain/graph/impl/GraphChain.java Tue May 17 22:20:49 2016 @@ -40,11 +40,11 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; -import org.apache.clerezza.rdf.core.Graph; -import org.apache.clerezza.rdf.core.MGraph; -import org.apache.clerezza.rdf.core.NonLiteral; -import org.apache.clerezza.rdf.core.impl.SimpleMGraph; -import org.apache.clerezza.rdf.core.impl.TripleImpl; +import org.apache.clerezza.commons.rdf.ImmutableGraph; +import org.apache.clerezza.commons.rdf.Graph; +import org.apache.clerezza.commons.rdf.BlankNodeOrIRI; +import org.apache.clerezza.commons.rdf.impl.utils.simple.SimpleGraph; +import org.apache.clerezza.commons.rdf.impl.utils.TripleImpl; import org.apache.clerezza.rdf.core.serializedform.Parser; import org.apache.commons.io.IOUtils; import org.apache.felix.scr.annotations.Activate; @@ -105,7 +105,7 @@ public class GraphChain extends Abstract protected final Logger log = LoggerFactory.getLogger(GraphChain.class); /** - * Property used to configure the Graph by using the line based + * Property used to configure the ImmutableGraph by using the line based * representation with the following Syntax: * <code><pre> * <engineName>;<parm1>=<value1>,<value2>;<parm2>=<value1>... @@ -217,10 +217,10 @@ public class GraphChain extends Abstract } } else { throw new ConfigurationException(PROPERTY_CHAIN_LIST, - "The list based configuration of a Graph Chain MUST BE " + + "The list based configuration of a ImmutableGraph Chain MUST BE " + "configured as a Array or Collection of Strings (parsed: "+ (list != null?list.getClass():"null")+"). NOTE you can also " + - "configure the Graph by pointing to a resource with the graph as" + + "configure the ImmutableGraph by pointing to a resource with the graph as" + "value of the property '"+PROPERTY_GRAPH_RESOURCE+"'."); } Map<String,Map<String,List<String>>> config; @@ -258,7 +258,7 @@ public class GraphChain extends Abstract super.deactivate(ctx); } @Override - public Graph getExecutionPlan() throws ChainException { + public ImmutableGraph getExecutionPlan() throws ChainException { return internalChain.getExecutionPlan(); } @@ -294,7 +294,7 @@ public class GraphChain extends Abstract * The executionPlan is parsed and validated within * {@link #updateExecutionPlan()} */ - private Graph executionPlan; + private ImmutableGraph executionPlan; /** * The referenced engine names. Use the {@link #resourceName} to sync * access.<p> @@ -302,7 +302,7 @@ public class GraphChain extends Abstract */ private Set<String> engineNames; /** - * Parser used to parse the RDF {@link Graph} from the {@link InputStream} + * Parser used to parse the RDF {@link ImmutableGraph} from the {@link InputStream} * provided to the {@link #available(String, InputStream)} method by the * {@link DataFileTracker}. */ @@ -365,7 +365,7 @@ public class GraphChain extends Abstract return false; //keep tracking } @Override - public Graph getExecutionPlan() throws ChainException { + public ImmutableGraph getExecutionPlan() throws ChainException { synchronized (resourceName) { if(executionPlan == null){ updateExecutionPlan(); @@ -426,7 +426,7 @@ public class GraphChain extends Abstract */ private final class ListConfigExecutionPlan implements Chain { - private final Graph executionPlan; + private final ImmutableGraph executionPlan; private final Set<String> engines; /** @@ -445,9 +445,9 @@ public class GraphChain extends Abstract "GraphChain '{}'",getName()); } engines = Collections.unmodifiableSet(new HashSet<String>(config.keySet())); - MGraph graph = new SimpleMGraph(); - NonLiteral epNode = createExecutionPlan(graph, getName(), chainProperties); - //caches the String name -> {NonLiteral node, List<Stirng> dependsOn} mappings + Graph graph = new SimpleGraph(); + BlankNodeOrIRI epNode = createExecutionPlan(graph, getName(), chainProperties); + //caches the String name -> {BlankNodeOrIRI node, List<Stirng> dependsOn} mappings Map<String,Object[]> name2nodes = new HashMap<String,Object[]>(); //1. write the nodes (without dependencies) for(Entry<String,Map<String,List<String>>> node : config.entrySet()){ @@ -470,9 +470,9 @@ public class GraphChain extends Abstract Object[] targetInfo = name2nodes.get(target); if(targetInfo != null){ graph.add(new TripleImpl( - (NonLiteral)info.getValue()[0], + (BlankNodeOrIRI)info.getValue()[0], ExecutionPlan.DEPENDS_ON, - (NonLiteral)targetInfo[0])); + (BlankNodeOrIRI)targetInfo[0])); } else { //reference to a undefined engine :( throw new IllegalArgumentException("The Engine '"+ @@ -483,11 +483,11 @@ public class GraphChain extends Abstract } } //this node has no dependencies } - this.executionPlan = graph.getGraph(); + this.executionPlan = graph.getImmutableGraph(); } @Override - public Graph getExecutionPlan() throws ChainException { + public ImmutableGraph getExecutionPlan() throws ChainException { return executionPlan; } Modified: stanbol/trunk/enhancer/chain/list/src/main/java/org/apache/stanbol/enhancer/chain/list/impl/ListChain.java URL: http://svn.apache.org/viewvc/stanbol/trunk/enhancer/chain/list/src/main/java/org/apache/stanbol/enhancer/chain/list/impl/ListChain.java?rev=1744328&r1=1744327&r2=1744328&view=diff ============================================================================== --- stanbol/trunk/enhancer/chain/list/src/main/java/org/apache/stanbol/enhancer/chain/list/impl/ListChain.java (original) +++ stanbol/trunk/enhancer/chain/list/src/main/java/org/apache/stanbol/enhancer/chain/list/impl/ListChain.java Tue May 17 22:20:49 2016 @@ -30,10 +30,10 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; -import org.apache.clerezza.rdf.core.Graph; -import org.apache.clerezza.rdf.core.MGraph; -import org.apache.clerezza.rdf.core.NonLiteral; -import org.apache.clerezza.rdf.core.impl.SimpleMGraph; +import org.apache.clerezza.commons.rdf.ImmutableGraph; +import org.apache.clerezza.commons.rdf.Graph; +import org.apache.clerezza.commons.rdf.BlankNodeOrIRI; +import org.apache.clerezza.commons.rdf.impl.utils.simple.SimpleGraph; import org.apache.felix.scr.annotations.Component; import org.apache.felix.scr.annotations.ConfigurationPolicy; import org.apache.felix.scr.annotations.Properties; @@ -101,7 +101,7 @@ public class ListChain extends AbstractC private Set<String> engineNames; - private Graph executionPlan; + private ImmutableGraph executionPlan; @Override @@ -124,9 +124,9 @@ public class ListChain extends AbstractC (value != null?value.getClass():"null")+")"); } Set<String> engineNames = new HashSet<String>(configuredChain.size()); - NonLiteral last = null; - MGraph ep = new SimpleMGraph(); - NonLiteral epNode = createExecutionPlan(ep, getName(), getChainProperties()); + BlankNodeOrIRI last = null; + Graph ep = new SimpleGraph(); + BlankNodeOrIRI epNode = createExecutionPlan(ep, getName(), getChainProperties()); log.debug("Parse ListChain config:"); for(String line : configuredChain){ try { @@ -151,7 +151,7 @@ public class ListChain extends AbstractC "The configured chain MUST at least contain a single valid entry!"); } this.engineNames = Collections.unmodifiableSet(engineNames); - this.executionPlan = ep.getGraph(); + this.executionPlan = ep.getImmutableGraph(); } @Override @@ -161,7 +161,7 @@ public class ListChain extends AbstractC super.deactivate(ctx); } @Override - public Graph getExecutionPlan() throws ChainException { + public ImmutableGraph getExecutionPlan() throws ChainException { return executionPlan; } Modified: stanbol/trunk/enhancer/chain/weighted/src/main/java/org/apache/stanbol/enhancer/chain/weighted/impl/WeightedChain.java URL: http://svn.apache.org/viewvc/stanbol/trunk/enhancer/chain/weighted/src/main/java/org/apache/stanbol/enhancer/chain/weighted/impl/WeightedChain.java?rev=1744328&r1=1744327&r2=1744328&view=diff ============================================================================== --- stanbol/trunk/enhancer/chain/weighted/src/main/java/org/apache/stanbol/enhancer/chain/weighted/impl/WeightedChain.java (original) +++ stanbol/trunk/enhancer/chain/weighted/src/main/java/org/apache/stanbol/enhancer/chain/weighted/impl/WeightedChain.java Tue May 17 22:20:49 2016 @@ -31,7 +31,7 @@ import java.util.Map; import java.util.Map.Entry; import java.util.Set; -import org.apache.clerezza.rdf.core.Graph; +import org.apache.clerezza.commons.rdf.ImmutableGraph; import org.apache.felix.scr.annotations.Component; import org.apache.felix.scr.annotations.ConfigurationPolicy; import org.apache.felix.scr.annotations.Properties; @@ -120,7 +120,7 @@ public class WeightedChain extends Abstr */ private Object epLock = new Object(); - private Graph executionPlan = null; + private ImmutableGraph executionPlan = null; @Override protected void activate(ComponentContext ctx) throws ConfigurationException { @@ -177,7 +177,7 @@ public class WeightedChain extends Abstr super.deactivate(ctx); } @Override - public Graph getExecutionPlan() throws ChainException { + public ImmutableGraph getExecutionPlan() throws ChainException { synchronized (epLock) { if(executionPlan == null){ executionPlan = createExecutionPlan(); @@ -199,7 +199,7 @@ public class WeightedChain extends Abstr * @throws ChainException if a required {@link EnhancementEngine} of the * configured {@link #chain} is not active. */ - private Graph createExecutionPlan() throws ChainException { + private ImmutableGraph createExecutionPlan() throws ChainException { List<EnhancementEngine> availableEngines = new ArrayList<EnhancementEngine>(chain.size()); Set<String> optionalEngines = new HashSet<String>(); Set<String> missingEngines = new HashSet<String>(); Modified: stanbol/trunk/enhancer/generic/core/src/main/java/org/apache/stanbol/enhancer/contentitem/file/FileContentItemFactory.java URL: http://svn.apache.org/viewvc/stanbol/trunk/enhancer/generic/core/src/main/java/org/apache/stanbol/enhancer/contentitem/file/FileContentItemFactory.java?rev=1744328&r1=1744327&r2=1744328&view=diff ============================================================================== --- stanbol/trunk/enhancer/generic/core/src/main/java/org/apache/stanbol/enhancer/contentitem/file/FileContentItemFactory.java (original) +++ stanbol/trunk/enhancer/generic/core/src/main/java/org/apache/stanbol/enhancer/contentitem/file/FileContentItemFactory.java Tue May 17 22:20:49 2016 @@ -30,8 +30,8 @@ import java.util.Collections; import java.util.HashMap; import java.util.Map; -import org.apache.clerezza.rdf.core.MGraph; -import org.apache.clerezza.rdf.core.UriRef; +import org.apache.clerezza.commons.rdf.Graph; +import org.apache.clerezza.commons.rdf.IRI; import org.apache.commons.io.IOUtils; import org.apache.felix.scr.annotations.Activate; import org.apache.felix.scr.annotations.Component; @@ -39,7 +39,7 @@ import org.apache.felix.scr.annotations. import org.apache.felix.scr.annotations.Properties; import org.apache.felix.scr.annotations.Property; import org.apache.felix.scr.annotations.Service; -import org.apache.stanbol.commons.indexedgraph.IndexedMGraph; +import org.apache.stanbol.commons.indexedgraph.IndexedGraph; import org.apache.stanbol.enhancer.servicesapi.Blob; import org.apache.stanbol.enhancer.servicesapi.ContentItem; import org.apache.stanbol.enhancer.servicesapi.ContentItemFactory; @@ -159,12 +159,12 @@ public class FileContentItemFactory exte } @Override - protected ContentItem createContentItem(UriRef id, Blob blob, MGraph metadata) { + protected ContentItem createContentItem(IRI id, Blob blob, Graph metadata) { return new FileContentItem(id, blob, metadata); } @Override - protected ContentItem createContentItem(String prefix, Blob blob, MGraph metadata) { + protected ContentItem createContentItem(String prefix, Blob blob, Graph metadata) { return new FileContentItem(prefix, blob, metadata); } @@ -391,7 +391,7 @@ public class FileContentItemFactory exte * prefix is <code>null</code> * @throws IllegalStateException if the parsed blob is not an {@link FileBlob} */ - protected UriRef getDefaultUri(Blob blob, String prefix) { + protected IRI getDefaultUri(Blob blob, String prefix) { if(blob == null){ throw new IllegalArgumentException("The parsed Blob MUST NOT be NULL!"); } @@ -399,7 +399,7 @@ public class FileContentItemFactory exte throw new IllegalArgumentException("The parsed prefix MUST NOT be NULL!"); } if(blob instanceof FileBlob) { - return new UriRef(prefix+SHA1.toLowerCase()+ '-' + ((FileBlob)blob).getSha1()); + return new IRI(prefix+SHA1.toLowerCase()+ '-' + ((FileBlob)blob).getSha1()); } else { throw new IllegalStateException("FileContentItem expects FileBlobs to be used" + "as Blob implementation (found: "+blob.getClass()+")!"); @@ -408,13 +408,13 @@ public class FileContentItemFactory exte protected class FileContentItem extends ContentItemImpl implements ContentItem { - public FileContentItem(UriRef id, Blob blob,MGraph metadata) { + public FileContentItem(IRI id, Blob blob,Graph metadata) { super(id == null ? getDefaultUri(blob, DEFAULT_CONTENT_ITEM_PREFIX) : id, blob, - metadata == null ? new IndexedMGraph() : metadata); + metadata == null ? new IndexedGraph() : metadata); } - public FileContentItem(String prefix, Blob blob,MGraph metadata) { + public FileContentItem(String prefix, Blob blob,Graph metadata) { super(getDefaultUri(blob, prefix), blob, - metadata == null ? new IndexedMGraph() : metadata); + metadata == null ? new IndexedGraph() : metadata); } Modified: stanbol/trunk/enhancer/generic/core/src/main/java/org/apache/stanbol/enhancer/contentitem/inmemory/InMemoryContentItem.java URL: http://svn.apache.org/viewvc/stanbol/trunk/enhancer/generic/core/src/main/java/org/apache/stanbol/enhancer/contentitem/inmemory/InMemoryContentItem.java?rev=1744328&r1=1744327&r2=1744328&view=diff ============================================================================== --- stanbol/trunk/enhancer/generic/core/src/main/java/org/apache/stanbol/enhancer/contentitem/inmemory/InMemoryContentItem.java (original) +++ stanbol/trunk/enhancer/generic/core/src/main/java/org/apache/stanbol/enhancer/contentitem/inmemory/InMemoryContentItem.java Tue May 17 22:20:49 2016 @@ -17,10 +17,10 @@ package org.apache.stanbol.enhancer.contentitem.inmemory; -import org.apache.clerezza.rdf.core.MGraph; -import org.apache.clerezza.rdf.core.UriRef; -import org.apache.clerezza.rdf.core.impl.SimpleMGraph; -import org.apache.stanbol.commons.indexedgraph.IndexedMGraph; +import org.apache.clerezza.commons.rdf.Graph; +import org.apache.clerezza.commons.rdf.IRI; +import org.apache.clerezza.commons.rdf.impl.utils.simple.SimpleGraph; +import org.apache.stanbol.commons.indexedgraph.IndexedGraph; import org.apache.stanbol.enhancer.servicesapi.Blob; import org.apache.stanbol.enhancer.servicesapi.ContentItemFactory; import org.apache.stanbol.enhancer.servicesapi.ContentSource; @@ -33,7 +33,7 @@ import org.apache.stanbol.enhancer.servi /** * ContentItem implementation that holds a complete copy of the data in * memory. Internally it uses {@link InMemoryBlob} to store the content and - * an {@link SimpleMGraph} for the metadata. + * an {@link SimpleGraph} for the metadata. * <p> * This implementation can be used independently of any store implementation and * is suitable for stateless processing. @@ -53,14 +53,14 @@ public class InMemoryContentItem extends * with a {@link ByteArraySource} */ public InMemoryContentItem(byte[] content, String mimeType) { - this((UriRef)null,new InMemoryBlob(content, mimeType),null); + this((IRI)null,new InMemoryBlob(content, mimeType),null); } /** * * @param id * @param content * @param mimeType - * @deprecated use {@link InMemoryContentItemFactory#createContentItem(UriRef, ContentSource)} + * @deprecated use {@link InMemoryContentItemFactory#createContentItem(IRI, ContentSource)} * with a {@link StringSource} instead. */ public InMemoryContentItem(String id, String content, String mimeType) { @@ -71,7 +71,7 @@ public class InMemoryContentItem extends * @param id * @param content * @param mimetype - * @deprecated use {@link InMemoryContentItemFactory#createContentItem(UriRef, ContentSource)} + * @deprecated use {@link InMemoryContentItemFactory#createContentItem(IRI, ContentSource)} * with a {@link ByteArraySource} instead. */ public InMemoryContentItem(String id, byte[] content, String mimetype) { @@ -83,12 +83,12 @@ public class InMemoryContentItem extends * @param id * @param content * @param mimetype - * @deprecated use {@link InMemoryContentItemFactory#createContentItem(UriRef, ContentSource,MGraph)} + * @deprecated use {@link InMemoryContentItemFactory#createContentItem(IRI, ContentSource,Graph)} * with a {@link ByteArraySource} instead. */ public InMemoryContentItem(String uriString, byte[] content, String mimeType, - MGraph metadata) { - this(uriString != null? new UriRef(uriString) : null , + Graph metadata) { + this(uriString != null? new IRI(uriString) : null , new InMemoryBlob(content, mimeType), metadata); } @@ -97,10 +97,10 @@ public class InMemoryContentItem extends * @param id * @param content * @param mimetype - * @deprecated use {@link InMemoryContentItemFactory#createContentItem(UriRef, ContentSource,MGraph)} + * @deprecated use {@link InMemoryContentItemFactory#createContentItem(IRI, ContentSource,Graph)} * with a {@link StringSource} instead. */ - public InMemoryContentItem(UriRef uriRef, String content, String mimeType) { + public InMemoryContentItem(IRI uriRef, String content, String mimeType) { this(uriRef, new InMemoryBlob(content, mimeType), null); } /** @@ -108,18 +108,18 @@ public class InMemoryContentItem extends * @param id * @param content * @param mimetype - * @deprecated use {@link InMemoryContentItemFactory#createContentItem(UriRef, ContentSource,MGraph)} + * @deprecated use {@link InMemoryContentItemFactory#createContentItem(IRI, ContentSource,Graph)} * with a {@link ByteArraySource} instead. */ - public InMemoryContentItem(UriRef uri, byte[] content, String mimeType, MGraph metadata) { + public InMemoryContentItem(IRI uri, byte[] content, String mimeType, Graph metadata) { this(uri, new InMemoryBlob(content, mimeType),metadata); } - protected InMemoryContentItem(String uriString, Blob blob, MGraph metadata) { - this(uriString != null ? new UriRef(uriString) : null, blob, metadata); + protected InMemoryContentItem(String uriString, Blob blob, Graph metadata) { + this(uriString != null ? new IRI(uriString) : null, blob, metadata); } - protected InMemoryContentItem(UriRef uri, Blob blob, MGraph metadata) { + protected InMemoryContentItem(IRI uri, Blob blob, Graph metadata) { super(uri == null ? ContentItemHelper.makeDefaultUrn(blob): uri,blob, - metadata == null ? new IndexedMGraph() : metadata); + metadata == null ? new IndexedGraph() : metadata); } /** Modified: stanbol/trunk/enhancer/generic/core/src/main/java/org/apache/stanbol/enhancer/contentitem/inmemory/InMemoryContentItemFactory.java URL: http://svn.apache.org/viewvc/stanbol/trunk/enhancer/generic/core/src/main/java/org/apache/stanbol/enhancer/contentitem/inmemory/InMemoryContentItemFactory.java?rev=1744328&r1=1744327&r2=1744328&view=diff ============================================================================== --- stanbol/trunk/enhancer/generic/core/src/main/java/org/apache/stanbol/enhancer/contentitem/inmemory/InMemoryContentItemFactory.java (original) +++ stanbol/trunk/enhancer/generic/core/src/main/java/org/apache/stanbol/enhancer/contentitem/inmemory/InMemoryContentItemFactory.java Tue May 17 22:20:49 2016 @@ -20,8 +20,8 @@ import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.OutputStream; -import org.apache.clerezza.rdf.core.MGraph; -import org.apache.clerezza.rdf.core.UriRef; +import org.apache.clerezza.commons.rdf.Graph; +import org.apache.clerezza.commons.rdf.IRI; import org.apache.felix.scr.annotations.Component; import org.apache.felix.scr.annotations.Properties; import org.apache.felix.scr.annotations.Property; @@ -62,12 +62,12 @@ public class InMemoryContentItemFactory } @Override - protected ContentItem createContentItem(UriRef id, Blob blob, MGraph metadata) { + protected ContentItem createContentItem(IRI id, Blob blob, Graph metadata) { return new InMemoryContentItem(id, blob, metadata); } @Override - protected ContentItem createContentItem(String prefix, Blob blob, MGraph metadata) { + protected ContentItem createContentItem(String prefix, Blob blob, Graph metadata) { return new InMemoryContentItem(ContentItemHelper.makeDefaultUri(prefix, blob), blob, metadata); } Modified: stanbol/trunk/enhancer/generic/nlp-json/src/main/java/org/apache/stanbol/enhancer/nlp/json/valuetype/impl/NerTagSupport.java URL: http://svn.apache.org/viewvc/stanbol/trunk/enhancer/generic/nlp-json/src/main/java/org/apache/stanbol/enhancer/nlp/json/valuetype/impl/NerTagSupport.java?rev=1744328&r1=1744327&r2=1744328&view=diff ============================================================================== --- stanbol/trunk/enhancer/generic/nlp-json/src/main/java/org/apache/stanbol/enhancer/nlp/json/valuetype/impl/NerTagSupport.java (original) +++ stanbol/trunk/enhancer/generic/nlp-json/src/main/java/org/apache/stanbol/enhancer/nlp/json/valuetype/impl/NerTagSupport.java Tue May 17 22:20:49 2016 @@ -16,7 +16,7 @@ */ package org.apache.stanbol.enhancer.nlp.json.valuetype.impl; -import org.apache.clerezza.rdf.core.UriRef; +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.Property; @@ -49,7 +49,7 @@ public class NerTagSupport implements Va } JsonNode uri = jValue.path("uri"); if(uri.isTextual()){ - return new NerTag(tag.getTextValue(), new UriRef(uri.getTextValue())); + return new NerTag(tag.getTextValue(), new IRI(uri.getTextValue())); } else { return new NerTag(tag.getTextValue()); } Modified: stanbol/trunk/enhancer/generic/nlp-json/src/test/java/org/apache/stanbol/enhancer/nlp/json/AnalyzedTextSerializerAndParserTest.java URL: http://svn.apache.org/viewvc/stanbol/trunk/enhancer/generic/nlp-json/src/test/java/org/apache/stanbol/enhancer/nlp/json/AnalyzedTextSerializerAndParserTest.java?rev=1744328&r1=1744327&r2=1744328&view=diff ============================================================================== --- stanbol/trunk/enhancer/generic/nlp-json/src/test/java/org/apache/stanbol/enhancer/nlp/json/AnalyzedTextSerializerAndParserTest.java (original) +++ stanbol/trunk/enhancer/generic/nlp-json/src/test/java/org/apache/stanbol/enhancer/nlp/json/AnalyzedTextSerializerAndParserTest.java Tue May 17 22:20:49 2016 @@ -30,7 +30,7 @@ import java.util.List; import java.util.Set; import java.util.Map.Entry; -import org.apache.clerezza.rdf.core.UriRef; +import org.apache.clerezza.commons.rdf.IRI; import org.apache.stanbol.enhancer.contentitem.inmemory.InMemoryContentItemFactory; import org.apache.stanbol.enhancer.nlp.NlpAnnotations; import org.apache.stanbol.enhancer.nlp.model.AnalysedText; @@ -108,7 +108,7 @@ public class AnalyzedTextSerializerAndPa private static ContentItem ci; - private static Entry<UriRef,Blob> textBlob; + private static Entry<IRI,Blob> textBlob; @BeforeClass public static final void setup() throws IOException { Modified: stanbol/trunk/enhancer/generic/nlp-json/src/test/java/org/apache/stanbol/enhancer/nlp/json/valuetype/ValueTypeSupportTest.java URL: http://svn.apache.org/viewvc/stanbol/trunk/enhancer/generic/nlp-json/src/test/java/org/apache/stanbol/enhancer/nlp/json/valuetype/ValueTypeSupportTest.java?rev=1744328&r1=1744327&r2=1744328&view=diff ============================================================================== --- stanbol/trunk/enhancer/generic/nlp-json/src/test/java/org/apache/stanbol/enhancer/nlp/json/valuetype/ValueTypeSupportTest.java (original) +++ stanbol/trunk/enhancer/generic/nlp-json/src/test/java/org/apache/stanbol/enhancer/nlp/json/valuetype/ValueTypeSupportTest.java Tue May 17 22:20:49 2016 @@ -11,7 +11,7 @@ import java.util.List; import java.util.Map.Entry; import java.util.Set; -import org.apache.clerezza.rdf.core.UriRef; +import org.apache.clerezza.commons.rdf.IRI; import org.apache.stanbol.enhancer.contentitem.inmemory.InMemoryContentItemFactory; import org.apache.stanbol.enhancer.nlp.json.AnalyzedTextParser; import org.apache.stanbol.enhancer.nlp.json.AnalyzedTextSerializer; @@ -42,7 +42,7 @@ public abstract class ValueTypeSupportTe private static ContentItem ci; - private static Entry<UriRef,Blob> textBlob; + private static Entry<IRI,Blob> textBlob; protected static void setupAnalysedText(String text) throws IOException { ci = ciFactory.createContentItem(new StringSource(text)); Modified: stanbol/trunk/enhancer/generic/nlp/src/main/java/org/apache/stanbol/enhancer/nlp/model/AnalysedText.java URL: http://svn.apache.org/viewvc/stanbol/trunk/enhancer/generic/nlp/src/main/java/org/apache/stanbol/enhancer/nlp/model/AnalysedText.java?rev=1744328&r1=1744327&r2=1744328&view=diff ============================================================================== --- stanbol/trunk/enhancer/generic/nlp/src/main/java/org/apache/stanbol/enhancer/nlp/model/AnalysedText.java (original) +++ stanbol/trunk/enhancer/generic/nlp/src/main/java/org/apache/stanbol/enhancer/nlp/model/AnalysedText.java Tue May 17 22:20:49 2016 @@ -19,26 +19,26 @@ package org.apache.stanbol.enhancer.nlp. import java.util.ConcurrentModificationException; import java.util.Iterator; -import org.apache.clerezza.rdf.core.UriRef; +import org.apache.clerezza.commons.rdf.IRI; import org.apache.stanbol.enhancer.servicesapi.Blob; import org.apache.stanbol.enhancer.servicesapi.ContentItem; /** * Provides access to NLP processing results of the <code>text/plain</code> * {@link Blob} of an ContentItem. Intended to be - * {@link ContentItem#addPart(org.apache.clerezza.rdf.core.UriRef, Object) added + * {@link ContentItem#addPart(org.apache.clerezza.commons.rdf.IRI, Object) added * as ContentPart} by using {@link #ANALYSED_TEXT_URI}. - * @see ContentItem#addPart(UriRef, Object) + * @see ContentItem#addPart(IRI, Object) */ public interface AnalysedText extends Section{ /** - * The {@link UriRef} used to register the {@link AnalysedText} instance - * as {@link ContentItem#addPart(org.apache.clerezza.rdf.core.UriRef, Object) + * The {@link IRI} used to register the {@link AnalysedText} instance + * as {@link ContentItem#addPart(org.apache.clerezza.commons.rdf.IRI, Object) * ContentPart} to the {@link ContentItem} */ - public static final UriRef ANALYSED_TEXT_URI = new UriRef("urn:stanbol.enhancer:nlp.analysedText"); + public static final IRI ANALYSED_TEXT_URI = new IRI("urn:stanbol.enhancer:nlp.analysedText"); /** * Returns {@link SpanTypeEnum#Text} Modified: stanbol/trunk/enhancer/generic/nlp/src/main/java/org/apache/stanbol/enhancer/nlp/model/AnalysedTextFactory.java URL: http://svn.apache.org/viewvc/stanbol/trunk/enhancer/generic/nlp/src/main/java/org/apache/stanbol/enhancer/nlp/model/AnalysedTextFactory.java?rev=1744328&r1=1744327&r2=1744328&view=diff ============================================================================== --- stanbol/trunk/enhancer/generic/nlp/src/main/java/org/apache/stanbol/enhancer/nlp/model/AnalysedTextFactory.java (original) +++ stanbol/trunk/enhancer/generic/nlp/src/main/java/org/apache/stanbol/enhancer/nlp/model/AnalysedTextFactory.java Tue May 17 22:20:49 2016 @@ -18,7 +18,7 @@ package org.apache.stanbol.enhancer.nlp. import java.io.IOException; -import org.apache.clerezza.rdf.core.UriRef; +import org.apache.clerezza.commons.rdf.IRI; import org.apache.stanbol.enhancer.nlp.model.impl.AnalysedTextFactoryImpl; import org.apache.stanbol.enhancer.servicesapi.Blob; import org.apache.stanbol.enhancer.servicesapi.ContentItem; @@ -40,10 +40,10 @@ public abstract class AnalysedTextFactor /** * Creates an {@link AnalysedText} instance for the parsed {@link Blob} * and registers itself as - * {@link ContentItem#addPart(org.apache.clerezza.rdf.core.UriRef, Object) - * ContentPart} with the {@link UriRef} {@link AnalysedText#ANALYSED_TEXT_URI} + * {@link ContentItem#addPart(org.apache.clerezza.commons.rdf.IRI, Object) + * ContentPart} with the {@link IRI} {@link AnalysedText#ANALYSED_TEXT_URI} * to the parsed {@link ContentItem}.<p> - * If already a ContentPart with the given UriRef is registered this + * If already a ContentPart with the given IRI is registered this * Method will throw an {@link IllegalStateException}. * @param ci the ContentItem to register the created {@link AnalysedText} instance * @param blob the analysed {@link Blob} Modified: stanbol/trunk/enhancer/generic/nlp/src/main/java/org/apache/stanbol/enhancer/nlp/model/AnalysedTextUtils.java URL: http://svn.apache.org/viewvc/stanbol/trunk/enhancer/generic/nlp/src/main/java/org/apache/stanbol/enhancer/nlp/model/AnalysedTextUtils.java?rev=1744328&r1=1744327&r2=1744328&view=diff ============================================================================== --- stanbol/trunk/enhancer/generic/nlp/src/main/java/org/apache/stanbol/enhancer/nlp/model/AnalysedTextUtils.java (original) +++ stanbol/trunk/enhancer/generic/nlp/src/main/java/org/apache/stanbol/enhancer/nlp/model/AnalysedTextUtils.java Tue May 17 22:20:49 2016 @@ -29,7 +29,7 @@ import java.util.SortedSet; import java.util.TreeSet; import java.util.Map.Entry; -import org.apache.clerezza.rdf.core.UriRef; +import org.apache.clerezza.commons.rdf.IRI; import org.apache.stanbol.enhancer.nlp.model.impl.SectionImpl; import org.apache.stanbol.enhancer.nlp.model.impl.SpanImpl; import org.apache.stanbol.enhancer.servicesapi.Blob; Modified: stanbol/trunk/enhancer/generic/nlp/src/main/java/org/apache/stanbol/enhancer/nlp/morpho/Case.java URL: http://svn.apache.org/viewvc/stanbol/trunk/enhancer/generic/nlp/src/main/java/org/apache/stanbol/enhancer/nlp/morpho/Case.java?rev=1744328&r1=1744327&r2=1744328&view=diff ============================================================================== --- stanbol/trunk/enhancer/generic/nlp/src/main/java/org/apache/stanbol/enhancer/nlp/morpho/Case.java (original) +++ stanbol/trunk/enhancer/generic/nlp/src/main/java/org/apache/stanbol/enhancer/nlp/morpho/Case.java Tue May 17 22:20:49 2016 @@ -20,7 +20,7 @@ import java.util.Collections; import java.util.EnumSet; import java.util.Set; -import org.apache.clerezza.rdf.core.UriRef; +import org.apache.clerezza.commons.rdf.IRI; /** * Defines verb tenses as defined by the <a href="">OLIA</a> Ontology. @@ -481,17 +481,17 @@ public enum Case { ; static final String OLIA_NAMESPACE = "http://purl.org/olia/olia.owl#"; - UriRef uri; + IRI uri; Case() { this(null); } Case(String name) { - uri = new UriRef(OLIA_NAMESPACE + (name == null ? name() : (name + "Case"))); + uri = new IRI(OLIA_NAMESPACE + (name == null ? name() : (name + "Case"))); } - public UriRef getUri() { + public IRI getUri() { return uri; } Modified: stanbol/trunk/enhancer/generic/nlp/src/main/java/org/apache/stanbol/enhancer/nlp/morpho/Definitness.java URL: http://svn.apache.org/viewvc/stanbol/trunk/enhancer/generic/nlp/src/main/java/org/apache/stanbol/enhancer/nlp/morpho/Definitness.java?rev=1744328&r1=1744327&r2=1744328&view=diff ============================================================================== --- stanbol/trunk/enhancer/generic/nlp/src/main/java/org/apache/stanbol/enhancer/nlp/morpho/Definitness.java (original) +++ stanbol/trunk/enhancer/generic/nlp/src/main/java/org/apache/stanbol/enhancer/nlp/morpho/Definitness.java Tue May 17 22:20:49 2016 @@ -16,7 +16,7 @@ */ package org.apache.stanbol.enhancer.nlp.morpho; -import org.apache.clerezza.rdf.core.UriRef; +import org.apache.clerezza.commons.rdf.IRI; public enum Definitness { /** @@ -38,13 +38,13 @@ public enum Definitness { */ Indefinite; static final String OLIA_NAMESPACE = "http://purl.org/olia/olia.owl#"; - UriRef uri; + IRI uri; Definitness() { - uri = new UriRef(OLIA_NAMESPACE + name()); + uri = new IRI(OLIA_NAMESPACE + name()); } - public UriRef getUri() { + public IRI getUri() { return uri; } Modified: stanbol/trunk/enhancer/generic/nlp/src/main/java/org/apache/stanbol/enhancer/nlp/morpho/Gender.java URL: http://svn.apache.org/viewvc/stanbol/trunk/enhancer/generic/nlp/src/main/java/org/apache/stanbol/enhancer/nlp/morpho/Gender.java?rev=1744328&r1=1744327&r2=1744328&view=diff ============================================================================== --- stanbol/trunk/enhancer/generic/nlp/src/main/java/org/apache/stanbol/enhancer/nlp/morpho/Gender.java (original) +++ stanbol/trunk/enhancer/generic/nlp/src/main/java/org/apache/stanbol/enhancer/nlp/morpho/Gender.java Tue May 17 22:20:49 2016 @@ -16,7 +16,7 @@ */ package org.apache.stanbol.enhancer.nlp.morpho; -import org.apache.clerezza.rdf.core.UriRef; +import org.apache.clerezza.commons.rdf.IRI; /** * Enumeration representing the different genders of words based on the <a @@ -60,17 +60,17 @@ public enum Gender { */ Neuter; static final String OLIA_NAMESPACE = "http://purl.org/olia/olia.owl#"; - UriRef uri; + IRI uri; Gender() { this(null); } Gender(String name) { - uri = new UriRef(OLIA_NAMESPACE + (name == null ? name() : name)); + uri = new IRI(OLIA_NAMESPACE + (name == null ? name() : name)); } - public UriRef getUri() { + public IRI getUri() { return uri; } Modified: stanbol/trunk/enhancer/generic/nlp/src/main/java/org/apache/stanbol/enhancer/nlp/morpho/NumberFeature.java URL: http://svn.apache.org/viewvc/stanbol/trunk/enhancer/generic/nlp/src/main/java/org/apache/stanbol/enhancer/nlp/morpho/NumberFeature.java?rev=1744328&r1=1744327&r2=1744328&view=diff ============================================================================== --- stanbol/trunk/enhancer/generic/nlp/src/main/java/org/apache/stanbol/enhancer/nlp/morpho/NumberFeature.java (original) +++ stanbol/trunk/enhancer/generic/nlp/src/main/java/org/apache/stanbol/enhancer/nlp/morpho/NumberFeature.java Tue May 17 22:20:49 2016 @@ -16,7 +16,7 @@ */ package org.apache.stanbol.enhancer.nlp.morpho; -import org.apache.clerezza.rdf.core.UriRef; +import org.apache.clerezza.commons.rdf.IRI; public enum NumberFeature { /** @@ -57,13 +57,13 @@ public enum NumberFeature { */ Trial; static final String OLIA_NAMESPACE = "http://purl.org/olia/olia.owl#"; - UriRef uri; + IRI uri; NumberFeature() { - uri = new UriRef(OLIA_NAMESPACE + name()); + uri = new IRI(OLIA_NAMESPACE + name()); } - public UriRef getUri() { + public IRI getUri() { return uri; } Modified: stanbol/trunk/enhancer/generic/nlp/src/main/java/org/apache/stanbol/enhancer/nlp/morpho/Person.java URL: http://svn.apache.org/viewvc/stanbol/trunk/enhancer/generic/nlp/src/main/java/org/apache/stanbol/enhancer/nlp/morpho/Person.java?rev=1744328&r1=1744327&r2=1744328&view=diff ============================================================================== --- stanbol/trunk/enhancer/generic/nlp/src/main/java/org/apache/stanbol/enhancer/nlp/morpho/Person.java (original) +++ stanbol/trunk/enhancer/generic/nlp/src/main/java/org/apache/stanbol/enhancer/nlp/morpho/Person.java Tue May 17 22:20:49 2016 @@ -16,7 +16,7 @@ */ package org.apache.stanbol.enhancer.nlp.morpho; -import org.apache.clerezza.rdf.core.UriRef; +import org.apache.clerezza.commons.rdf.IRI; /** * Enumeration representing the different persons of words based on the <a* @@ -44,17 +44,17 @@ public enum Person { Third("ThirdPerson"); static final String OLIA_NAMESPACE = "http://purl.org/olia/olia.owl#"; - UriRef uri; + IRI uri; Person() { this(null); } Person(String name) { - uri = new UriRef(OLIA_NAMESPACE + (name == null ? name() : name)); + uri = new IRI(OLIA_NAMESPACE + (name == null ? name() : name)); } - public UriRef getUri() { + public IRI getUri() { return uri; } Modified: stanbol/trunk/enhancer/generic/nlp/src/main/java/org/apache/stanbol/enhancer/nlp/morpho/Tense.java URL: http://svn.apache.org/viewvc/stanbol/trunk/enhancer/generic/nlp/src/main/java/org/apache/stanbol/enhancer/nlp/morpho/Tense.java?rev=1744328&r1=1744327&r2=1744328&view=diff ============================================================================== --- stanbol/trunk/enhancer/generic/nlp/src/main/java/org/apache/stanbol/enhancer/nlp/morpho/Tense.java (original) +++ stanbol/trunk/enhancer/generic/nlp/src/main/java/org/apache/stanbol/enhancer/nlp/morpho/Tense.java Tue May 17 22:20:49 2016 @@ -22,7 +22,7 @@ import java.util.EnumSet; import java.util.Map; import java.util.Set; -import org.apache.clerezza.rdf.core.UriRef; +import org.apache.clerezza.commons.rdf.IRI; /** * Defines verb tenses as defined by the * <a href="">OLIA</a> Ontology.<p> @@ -67,7 +67,7 @@ public enum Tense { RelativePresent(Relative), ; static final String OLIA_NAMESPACE = "http://purl.org/olia/olia.owl#"; - UriRef uri; + IRI uri; Tense parent; Tense() { @@ -81,7 +81,7 @@ public enum Tense { this(name,null); } Tense(String name,Tense parent) { - uri = new UriRef(OLIA_NAMESPACE + (name == null ? name() : name)); + uri = new IRI(OLIA_NAMESPACE + (name == null ? name() : name)); this.parent = parent; } /** @@ -113,7 +113,7 @@ public enum Tense { return transitiveClosureMap.get(this); } - public UriRef getUri() { + public IRI getUri() { return uri; } Modified: stanbol/trunk/enhancer/generic/nlp/src/main/java/org/apache/stanbol/enhancer/nlp/morpho/VerbMood.java URL: http://svn.apache.org/viewvc/stanbol/trunk/enhancer/generic/nlp/src/main/java/org/apache/stanbol/enhancer/nlp/morpho/VerbMood.java?rev=1744328&r1=1744327&r2=1744328&view=diff ============================================================================== --- stanbol/trunk/enhancer/generic/nlp/src/main/java/org/apache/stanbol/enhancer/nlp/morpho/VerbMood.java (original) +++ stanbol/trunk/enhancer/generic/nlp/src/main/java/org/apache/stanbol/enhancer/nlp/morpho/VerbMood.java Tue May 17 22:20:49 2016 @@ -16,7 +16,7 @@ */ package org.apache.stanbol.enhancer.nlp.morpho; -import org.apache.clerezza.rdf.core.UriRef; +import org.apache.clerezza.commons.rdf.IRI; /** * Enumeration representing the different verbal moods based on the <a* href="http://purl.org/olia/olia.owl">OLIA</a> Ontology * @@ -71,16 +71,16 @@ public enum VerbMood { IndicativeVerb, ; static final String OLIA_NAMESPACE = "http://purl.org/olia/olia.owl#"; - UriRef uri; + IRI uri; VerbMood() { this(null); } VerbMood(String name) { - uri = new UriRef(OLIA_NAMESPACE + (name == null ? name() : (name + "Verb Form"))); + uri = new IRI(OLIA_NAMESPACE + (name == null ? name() : (name + "Verb Form"))); } - public UriRef getUri() { + public IRI getUri() { return uri; } Modified: stanbol/trunk/enhancer/generic/nlp/src/main/java/org/apache/stanbol/enhancer/nlp/ner/NerTag.java URL: http://svn.apache.org/viewvc/stanbol/trunk/enhancer/generic/nlp/src/main/java/org/apache/stanbol/enhancer/nlp/ner/NerTag.java?rev=1744328&r1=1744327&r2=1744328&view=diff ============================================================================== --- stanbol/trunk/enhancer/generic/nlp/src/main/java/org/apache/stanbol/enhancer/nlp/ner/NerTag.java (original) +++ stanbol/trunk/enhancer/generic/nlp/src/main/java/org/apache/stanbol/enhancer/nlp/ner/NerTag.java Tue May 17 22:20:49 2016 @@ -16,17 +16,17 @@ */ package org.apache.stanbol.enhancer.nlp.ner; -import org.apache.clerezza.rdf.core.UriRef; +import org.apache.clerezza.commons.rdf.IRI; import org.apache.stanbol.enhancer.nlp.model.tag.Tag; public class NerTag extends Tag<NerTag> { - private UriRef type; + private IRI type; public NerTag(String tag) { super(tag); } - public NerTag(String tag,UriRef type) { + public NerTag(String tag,IRI type) { super(tag); this.type = type; } @@ -36,7 +36,7 @@ public class NerTag extends Tag<NerTag> * @return the <code>dc:type</code> of the Named Entity * as also used by the <code>fise:TextAnnotation</code> */ - public UriRef getType() { + public IRI getType() { return type; }
