You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@stanbol.apache.org by rw...@apache.org on 2014/10/27 16:31:29 UTC

svn commit: r1634576 - in /stanbol/trunk/enhancement-engines/nlp2rdf/src/main: java/org/apache/stanbol/enhancer/engines/nlp2rdf/engine/ resources/OSGI-INF/metatype/

Author: rwesten
Date: Mon Oct 27 15:31:29 2014
New Revision: 1634576

URL: http://svn.apache.org/r1634576
Log:
STANBOL-1397: Added several configuration options to the NIF 2.0 engine. Also improved RDF serialization for single token phrases. Added support for nif:before and nif:after

Modified:
    stanbol/trunk/enhancement-engines/nlp2rdf/src/main/java/org/apache/stanbol/enhancer/engines/nlp2rdf/engine/Nif20Helper.java
    stanbol/trunk/enhancement-engines/nlp2rdf/src/main/java/org/apache/stanbol/enhancer/engines/nlp2rdf/engine/Nif20MetadataEngine.java
    stanbol/trunk/enhancement-engines/nlp2rdf/src/main/resources/OSGI-INF/metatype/metatype.properties

Modified: stanbol/trunk/enhancement-engines/nlp2rdf/src/main/java/org/apache/stanbol/enhancer/engines/nlp2rdf/engine/Nif20Helper.java
URL: http://svn.apache.org/viewvc/stanbol/trunk/enhancement-engines/nlp2rdf/src/main/java/org/apache/stanbol/enhancer/engines/nlp2rdf/engine/Nif20Helper.java?rev=1634576&r1=1634575&r2=1634576&view=diff
==============================================================================
--- stanbol/trunk/enhancement-engines/nlp2rdf/src/main/java/org/apache/stanbol/enhancer/engines/nlp2rdf/engine/Nif20Helper.java (original)
+++ stanbol/trunk/enhancement-engines/nlp2rdf/src/main/java/org/apache/stanbol/enhancer/engines/nlp2rdf/engine/Nif20Helper.java Mon Oct 27 15:31:29 2014
@@ -27,11 +27,13 @@ import java.io.Writer;
 import java.nio.charset.Charset;
 import java.util.Collections;
 import java.util.EnumMap;
+import java.util.Iterator;
 import java.util.Map;
 
 import org.apache.clerezza.rdf.core.Language;
 import org.apache.clerezza.rdf.core.LiteralFactory;
 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.rdf.core.impl.PlainLiteralImpl;
 import org.apache.clerezza.rdf.core.impl.TripleImpl;
@@ -201,55 +203,6 @@ public final class Nif20Helper {
         }
     }
 
-    /**
-     * Writes basic information of the parsed span by using NIF 1.0 including the
-     * {@link SsoOntology} Sentence/Phrase/Word type based on 
-     * the {@link Span#getType()}<p>
-     * As {@link AnalysedText} is based on the plain text version of the ContentItem
-     * this uses the {@link StringOntology#OffsetBasedString} notation.<p>
-     * <i>NOTE:</i> This DOES NOT write string relations, lemma, pos ... information
-     * that might be stored as {@link Annotation} with the parsed {@link Span}.
-     * @param graph the graph to add the triples
-     * @param base the base URI
-     * @param text the {@link AnalysedText}
-     * @param language the {@link Language} or <code>null</code> if not known
-     * @param span the {@link Span} to write.
-     * @return the {@link UriRef} representing the parsed {@link Span} in the
-     * graph
-     */
-    public static UriRef writeSpan(MGraph graph, UriRef base, AnalysedText text, Language language, Span span){
-        UriRef segment = getNifRFC5147URI(base, span.getStart(), 
-        		span.getType() == SpanTypeEnum.Text ? -1 : span.getEnd());
-        graph.add(new TripleImpl(segment, RDF_TYPE, Nif20.RFC5147String.getUri()));
-        if(span.getEnd() - span.getStart() < 100){
-	        graph.add(new TripleImpl(segment, Nif20.anchorOf.getUri(), 
-	            new PlainLiteralImpl(span.getSpan(),language)));
-        } else {
-        	graph.add(new TripleImpl(segment, Nif20.head.getUri(), 
-	            new PlainLiteralImpl(span.getSpan().substring(0,10),language)));
-        }
-        graph.add(new TripleImpl(segment, Nif20.beginIndex.getUri(), 
-            lf.createTypedLiteral(span.getStart())));
-        graph.add(new TripleImpl(segment, Nif20.endIndex.getUri(), 
-            lf.createTypedLiteral(span.getEnd())));
-        switch (span.getType()) {
-            case Token:
-                graph.add(new TripleImpl(segment, RDF_TYPE, Nif20.Word.getUri()));
-                break;
-            case Chunk:
-                graph.add(new TripleImpl(segment, RDF_TYPE, Nif20.Phrase.getUri()));
-                break;
-            case Sentence:
-                graph.add(new TripleImpl(segment, RDF_TYPE, Nif20.Sentence.getUri()));
-                break;
-            case Text:
-                graph.add(new TripleImpl(segment, RDF_TYPE, Nif20.Context.getUri()));
-                break;
-            default:
-            	// no default:
-        }
-        return segment;
-    }
     
     /**
      * Writes the {@link NlpAnnotations#POS_ANNOTATION} as NIF 1.0 to the parsed
@@ -274,8 +227,30 @@ public final class Nif20Helper {
             }
             graph.add(new TripleImpl(segmentUri, Nif20.posTag.getUri(), 
                 lf.createTypedLiteral(posTag.value().getTag())));
-            graph.add(new TripleImpl(segmentUri, ENHANCER_CONFIDENCE, 
-                lf.createTypedLiteral(posTag.probability())));
+            //set the oliaConf
+            //remove existing conf values (e.g. for a single word phrase)
+            setOliaConf(graph, segmentUri, posTag);
+        }
+    }
+    /**
+     * Sets the {@link Nif20#oliaConf} value. Note this also deletes existing
+     * values. This mans that in the case of multiple Olia annotation (e.g. 
+     * single word phrases together with word level annotation) the last
+     * confidence will win (still better as having two confidence values)
+     * @param graph
+     * @param segmentUri
+     * @param value
+     */
+    private static void setOliaConf(MGraph graph, UriRef segmentUri,
+            Value<?> value) {
+        Iterator<Triple> existingConfValues = graph.filter(segmentUri, Nif20.oliaConf.getUri(), null);
+        while(existingConfValues.hasNext()){
+            existingConfValues.next();
+            existingConfValues.remove();
+        }
+        if(value.probability() != Value.UNKNOWN_PROBABILITY){
+            graph.add(new TripleImpl(segmentUri, Nif20.oliaConf.getUri(), 
+                lf.createTypedLiteral(value.probability())));
         }
     }    
     
@@ -293,8 +268,7 @@ public final class Nif20Helper {
             UriRef phraseTypeUri = LEXICAL_TYPE_TO_PHRASE_TYPE.get(phraseTag.value().getCategory());
             if(phraseTypeUri != null){ //add the oliaLink for the Phrase
                 graph.add(new TripleImpl(segmentUri, Nif20.oliaCategory.getUri(), phraseTypeUri));
-                graph.add(new TripleImpl(segmentUri, ENHANCER_CONFIDENCE, 
-                    lf.createTypedLiteral(phraseTag.probability())));
+                setOliaConf(graph, segmentUri, phraseTag);
             }
         }
     }

Modified: stanbol/trunk/enhancement-engines/nlp2rdf/src/main/java/org/apache/stanbol/enhancer/engines/nlp2rdf/engine/Nif20MetadataEngine.java
URL: http://svn.apache.org/viewvc/stanbol/trunk/enhancement-engines/nlp2rdf/src/main/java/org/apache/stanbol/enhancer/engines/nlp2rdf/engine/Nif20MetadataEngine.java?rev=1634576&r1=1634575&r2=1634576&view=diff
==============================================================================
--- stanbol/trunk/enhancement-engines/nlp2rdf/src/main/java/org/apache/stanbol/enhancer/engines/nlp2rdf/engine/Nif20MetadataEngine.java (original)
+++ stanbol/trunk/enhancement-engines/nlp2rdf/src/main/java/org/apache/stanbol/enhancer/engines/nlp2rdf/engine/Nif20MetadataEngine.java Mon Oct 27 15:31:29 2014
@@ -17,6 +17,8 @@
 package org.apache.stanbol.enhancer.engines.nlp2rdf.engine;
 
 import static org.apache.stanbol.enhancer.nlp.utils.NlpEngineHelper.getAnalysedText;
+import static org.apache.stanbol.enhancer.servicesapi.helper.EnhancementEngineHelper.DEFAULT_PREFIX_SUFFIX_LENGTH;
+import static org.apache.stanbol.enhancer.servicesapi.rdf.Properties.RDF_TYPE;
 
 import java.util.Collections;
 import java.util.Dictionary;
@@ -28,6 +30,7 @@ import org.apache.clerezza.rdf.core.Lang
 import org.apache.clerezza.rdf.core.LiteralFactory;
 import org.apache.clerezza.rdf.core.MGraph;
 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.felix.scr.annotations.Activate;
 import org.apache.felix.scr.annotations.Component;
@@ -39,6 +42,7 @@ import org.apache.stanbol.enhancer.nlp.N
 import org.apache.stanbol.enhancer.nlp.model.AnalysedText;
 import org.apache.stanbol.enhancer.nlp.model.Span;
 import org.apache.stanbol.enhancer.nlp.model.SpanTypeEnum;
+import org.apache.stanbol.enhancer.nlp.model.annotation.Annotation;
 import org.apache.stanbol.enhancer.nlp.model.annotation.Value;
 import org.apache.stanbol.enhancer.nlp.nif.Nif20;
 import org.apache.stanbol.enhancer.servicesapi.ContentItem;
@@ -58,10 +62,68 @@ import org.slf4j.LoggerFactory;
     policy = ConfigurationPolicy.OPTIONAL) //create a default instance
 @Service
 @Properties(value={
-        @Property(name= EnhancementEngine.PROPERTY_NAME,value="nif20")
+        @Property(name=EnhancementEngine.PROPERTY_NAME,value="nif20"),
+        @Property(name=Nif20MetadataEngine.PROP_SELECTOR_STATE, 
+            boolValue=Nif20MetadataEngine.DEFAULT_SELECTOR_STATE),
+        @Property(name=Nif20MetadataEngine.PROP_CONTEXT_ONLY_URI_SCHEME, 
+            boolValue=Nif20MetadataEngine.DEFAULT_CONTEXT_ONLY_URI_SCHEME),
+        @Property(name=Nif20MetadataEngine.PROP_WRITE_STRING_TYPE, 
+            boolValue=Nif20MetadataEngine.DEFAULT_WRITE_STRING_TYPE),
+        @Property(name=Nif20MetadataEngine.PROP_HIERARCHY_LINKS_STATE,
+            boolValue=Nif20MetadataEngine.DEFAULT_HIERARCHY_LINKS_STATE),
+        @Property(name=Nif20MetadataEngine.PROP_PREVIOUSE_NEXT_LINKS_STATE, 
+            boolValue=Nif20MetadataEngine.DEFAULT_PREVIOUSE_NEXT_LINKS_STATE)
 })
 public class Nif20MetadataEngine extends AbstractEnhancementEngine<RuntimeException,RuntimeException> implements ServiceProperties{
 
+    /**
+     * Switch that allows to enable/disable writing of hierarchical links. This
+     * includes <code>olia:sentence</code>, <code>olia:superString</code> and
+     * <code>olia:subString</code> properties.
+     */
+    public final static String PROP_HIERARCHY_LINKS_STATE = "enhancer.engines.nlp2rdf.hierarchy";
+    /**
+     * switch that allows to enable/disable writing of next and previous links 
+     * between words, sentences ...
+     */
+    public final static String PROP_PREVIOUSE_NEXT_LINKS_STATE = "enhancer.engines.nlp2rdf.previousNext";
+    /**
+     * If enabled Selector related properties such as begin-/end-index, before/after, ...
+     * are written. If disabled only the URI is generated (which is sufficient for
+     * clients that know about the semantics of how the URI is build). Deactivating
+     * this will greatly decrease the triple count.
+     */
+    public final static String PROP_SELECTOR_STATE = "enhancer.engines.nlp2rdf.selector";
+    /**
+     * If enabled the {@link Nif20#URIScheme nif:URIScheme} ( typically 
+     * {@link Nif20#RFC5147String nif:RFC5147String}) type will only be added 
+     * for the {@link Nif20#Context nif:Context} and not
+     * all {@link Nif20#String nif:String} instances. If enabled clients need 
+     * follow the {@link Nif20#referenceContext nif:referenceContext} to the 
+     * {@link Nif20#Context nif:Context} for getting the used 
+     * {@link Nif20#URIScheme nif:URIScheme}<p>
+     */
+    public final static String PROP_CONTEXT_ONLY_URI_SCHEME = "enhancer.engines.nlp2rdf.cotextOnlyUriScheme";
+    /**
+     * If enabled the {@link Nif20#String nif:String} type is added to all written
+     * String. If disabled it is only written if their is no more specific type (
+     * such as {@link Nif20#Sentence nif:Sentence} or {@link Nif20#Word nif:Word}.
+     */
+    public final static String PROP_WRITE_STRING_TYPE = "enhancer.engines.nlp2rdf.writeStringType";
+    
+    public static final boolean DEFAULT_HIERARCHY_LINKS_STATE = true;
+    public static final boolean DEFAULT_PREVIOUSE_NEXT_LINKS_STATE = true;
+    public static final boolean DEFAULT_SELECTOR_STATE = true;
+    public static final boolean DEFAULT_CONTEXT_ONLY_URI_SCHEME = false;
+    public static final boolean DEFAULT_WRITE_STRING_TYPE = false; 
+
+    
+    private boolean writeHierary = DEFAULT_HIERARCHY_LINKS_STATE;
+    private boolean writePrevNext = DEFAULT_PREVIOUSE_NEXT_LINKS_STATE;
+    private boolean writeSelectors = DEFAULT_SELECTOR_STATE;
+    private boolean contextOnlyUriScheme = DEFAULT_CONTEXT_ONLY_URI_SCHEME;
+    private boolean writeStringType = DEFAULT_WRITE_STRING_TYPE;
+    
     private final Logger log = LoggerFactory.getLogger(Nif20MetadataEngine.class);
     //TODO: replace this with a reald ontology
     private final static UriRef SENTIMENT_PROPERTY = new UriRef(NamespaceEnum.fise+"sentiment-value");
@@ -78,10 +140,23 @@ public class Nif20MetadataEngine extends
         log.info("activating POS tagging engine");
         super.activate(ce);
         @SuppressWarnings("unchecked")
-        Dictionary<String, Object> properties = ce.getProperties();
-        //TODO: read configuration
+        Dictionary<String, Object> props = ce.getProperties();
+        writeHierary = getState(props, PROP_HIERARCHY_LINKS_STATE, DEFAULT_HIERARCHY_LINKS_STATE);
+        writePrevNext = getState(props, PROP_PREVIOUSE_NEXT_LINKS_STATE, DEFAULT_PREVIOUSE_NEXT_LINKS_STATE);
+        writeSelectors = getState(props, PROP_SELECTOR_STATE, DEFAULT_SELECTOR_STATE);
+        contextOnlyUriScheme = getState(props, PROP_CONTEXT_ONLY_URI_SCHEME, DEFAULT_CONTEXT_ONLY_URI_SCHEME);
+        writeStringType = getState(props, PROP_WRITE_STRING_TYPE, DEFAULT_WRITE_STRING_TYPE);
     }
     
+    private boolean getState(Dictionary<String, Object> props,
+            String prop, boolean def) {
+        Object val = props.get(prop);
+        boolean state = val == null ? def : val instanceof Boolean ? ((Boolean)val).booleanValue() :
+            Boolean.parseBoolean(val.toString());
+        log.debug(" - {}: {}",prop,state);
+        return state;
+    }
+
     @Override
     public int canEnhance(ContentItem ci) throws EngineException {
         return getAnalysedText(this, ci, false) != null ? 
@@ -113,10 +188,10 @@ public class Nif20MetadataEngine extends
         UriRef base = ci.getUri();
         ci.getLock().writeLock().lock();
         try {
-        	//write the context
-        	UriRef text = Nif20Helper.writeSpan(metadata, base, at, language, at);
-    		metadata.add(new TripleImpl(text, Nif20.sourceUrl.getUri(), ci.getUri()));
-        	
+            //write the context
+            UriRef text = writeSpan(metadata, base, at, language, at);
+            metadata.add(new TripleImpl(text, Nif20.sourceUrl.getUri(), ci.getUri()));
+            
             Iterator<Span> spans = at.getEnclosed(activeTypes);
             UriRef sentence = null;
             UriRef phrase = null;
@@ -126,39 +201,43 @@ public class Nif20MetadataEngine extends
                 Span span = spans.next();
                 //TODO: filter Spans based on additional requirements
                 //(1) write generic information about the span
-                UriRef current = Nif20Helper.writeSpan(metadata, base, at, language, span);
+                UriRef current = writeSpan(metadata, base, at, language, span);
                 //write the context
                 metadata.add(new TripleImpl(current, Nif20.referenceContext.getUri(), text));
                 //(2) add the relations between the different spans
                 switch (span.getType()) {
                     case Sentence:
-                        if(sentence != null){
+                        if(sentence != null && writePrevNext){
                             metadata.add(new TripleImpl(sentence, Nif20.nextSentence.getUri(), current));
+                            metadata.add(new TripleImpl(current, Nif20.previousSentence.getUri(), sentence));
+                        }
+                        if(word != null){
+                            metadata.add(new TripleImpl(sentence, Nif20.lastWord.getUri(), word));
                         }
                         sentence = current;
                         firstWordInSentence = true;
                         break;
                     case Chunk:
-                        if(sentence != null){
+                        if(sentence != null && writeHierary){
                             metadata.add(new TripleImpl(current, Nif20.superString.getUri(), sentence));
-                            if(word != null){
-                                metadata.add(new TripleImpl(word, Nif20.lastWord.getUri(), sentence));
-                            }
                         }
                         phrase = current;
                         break;
                     case Token:
                         if(sentence != null){
-                            metadata.add(new TripleImpl(current, Nif20.sentence.getUri(), sentence));
+                            if(writeHierary){
+                                metadata.add(new TripleImpl(current, Nif20.sentence.getUri(), sentence));
+                            }
+                            //metadata.add(new TripleImpl(sentence, Nif20.word.getUri(), current));
                             if(firstWordInSentence){
-                                metadata.add(new TripleImpl(current, Nif20.firstWord.getUri(), sentence));
+                                metadata.add(new TripleImpl(sentence, Nif20.firstWord.getUri(), current));
                                 firstWordInSentence = false;
                             }
                         }
-                        if(phrase != null){
+                        if(writeHierary && phrase != null && !phrase.equals(current)){
                             metadata.add(new TripleImpl(current, Nif20.subString.getUri(), phrase));
                         }
-                        if(word != null){
+                        if(word != null && writePrevNext){
                             metadata.add(new TripleImpl(word, Nif20.nextWord.getUri(), current));
                             metadata.add(new TripleImpl(current, Nif20.previousWord.getUri(), word));
                         }
@@ -168,10 +247,10 @@ public class Nif20MetadataEngine extends
                         break;
                 }
                 //(3) add specific information such as POS, chunk type ...
-                Nif20Helper.writePos(metadata, span, current);
                 Nif20Helper.writePhrase(metadata, span, current);
+                Nif20Helper.writePos(metadata, span, current);
 
-                //OlIA does not include Sentiments
+                //TODO: sentiment support
                 
                 Value<Double> sentiment = span.getAnnotation(NlpAnnotations.SENTIMENT_ANNOTATION);
                 if(sentiment != null && sentiment.value() != null){
@@ -190,7 +269,74 @@ public class Nif20MetadataEngine extends
             (Object)ServiceProperties.ORDERING_POST_PROCESSING);
     }
 
-
+    /**
+     * Writes basic information of the parsed span by using NIF 1.0 including the
+     * {@link SsoOntology} Sentence/Phrase/Word type based on 
+     * the {@link Span#getType()}<p>
+     * As {@link AnalysedText} is based on the plain text version of the ContentItem
+     * this uses the {@link StringOntology#OffsetBasedString} notation.<p>
+     * <i>NOTE:</i> This DOES NOT write string relations, lemma, pos ... information
+     * that might be stored as {@link Annotation} with the parsed {@link Span}.
+     * @param graph the graph to add the triples
+     * @param base the base URI
+     * @param text the {@link AnalysedText}
+     * @param language the {@link Language} or <code>null</code> if not known
+     * @param span the {@link Span} to write.
+     * @return the {@link UriRef} representing the parsed {@link Span} in the
+     * graph
+     */
+    public UriRef writeSpan(MGraph graph, UriRef base, AnalysedText text, Language language, Span span){
+        UriRef segment = Nif20Helper.getNifRFC5147URI(base, span.getStart(), 
+                span.getType() == SpanTypeEnum.Text ? -1 : span.getEnd());
+        if(!contextOnlyUriScheme || span.getType() == SpanTypeEnum.Text){
+            graph.add(new TripleImpl(segment, RDF_TYPE, Nif20.RFC5147String.getUri()));
+        }
+        if(writeSelectors){
+            if(span.getEnd() - span.getStart() < 100){
+                graph.add(new TripleImpl(segment, Nif20.anchorOf.getUri(), 
+                    new PlainLiteralImpl(span.getSpan(),language)));
+            } else {
+                graph.add(new TripleImpl(segment, Nif20.head.getUri(), 
+                    new PlainLiteralImpl(span.getSpan().substring(0,10),language)));
+            }
+            graph.add(new TripleImpl(segment, Nif20.beginIndex.getUri(), 
+                lf.createTypedLiteral(span.getStart())));
+            graph.add(new TripleImpl(segment, Nif20.endIndex.getUri(), 
+                lf.createTypedLiteral(span.getEnd())));
+            String content = text.getSpan();
+            if(span.getType() != SpanTypeEnum.Text){
+                //prefix and suffix
+                int prefixStart = Math.max(0, span.getStart() - DEFAULT_PREFIX_SUFFIX_LENGTH);
+                graph.add(new TripleImpl(segment, Nif20.before.getUri(), new PlainLiteralImpl(
+                        content.substring(prefixStart, span.getStart()), language)));
+                int suffixEnd = Math.min(span.getEnd() + DEFAULT_PREFIX_SUFFIX_LENGTH, text.getEnd());
+                graph.add(new TripleImpl(segment, Nif20.after.getUri(), new PlainLiteralImpl(
+                        content.substring(span.getEnd(), suffixEnd), language)));
+            }
+        }
+        if(writeStringType){
+            graph.add(new TripleImpl(segment, RDF_TYPE, Nif20.String.getUri()));
+        }
+        switch (span.getType()) {
+            case Token:
+                graph.add(new TripleImpl(segment, RDF_TYPE, Nif20.Word.getUri()));
+                break;
+            case Chunk:
+                graph.add(new TripleImpl(segment, RDF_TYPE, Nif20.Phrase.getUri()));
+                break;
+            case Sentence:
+                graph.add(new TripleImpl(segment, RDF_TYPE, Nif20.Sentence.getUri()));
+                break;
+            case Text:
+                graph.add(new TripleImpl(segment, RDF_TYPE, Nif20.Context.getUri()));
+                break;
+            default:
+                if(!writeStringType){
+                    graph.add(new TripleImpl(segment, RDF_TYPE, Nif20.String.getUri()));
+                } //string type was already added
+        }
+        return segment;
+    }
 
 
 

Modified: stanbol/trunk/enhancement-engines/nlp2rdf/src/main/resources/OSGI-INF/metatype/metatype.properties
URL: http://svn.apache.org/viewvc/stanbol/trunk/enhancement-engines/nlp2rdf/src/main/resources/OSGI-INF/metatype/metatype.properties?rev=1634576&r1=1634575&r2=1634576&view=diff
==============================================================================
--- stanbol/trunk/enhancement-engines/nlp2rdf/src/main/resources/OSGI-INF/metatype/metatype.properties (original)
+++ stanbol/trunk/enhancement-engines/nlp2rdf/src/main/resources/OSGI-INF/metatype/metatype.properties Mon Oct 27 15:31:29 2014
@@ -1,21 +1,21 @@
 #
 # Copyright 2012, FORMCEPT [http://www.formcept.com]
 #
-# Licensed under the Apache License, Version 2.0 (the "License");
+# Licensed under the Apache License, Version 2.0 (the License);
 # you may not use this file except in compliance with the License.
 # You may obtain a copy of the License at
 #
 #     http://www.apache.org/licenses/LICENSE-2.0
 #
 # Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
+# distributed under the License is distributed on an AS IS BASIS,
 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 # See the License for the specific language governing permissions and
 # limitations under the License.
 #
 
 org.apache.stanbol.enhancer.engines.nlp2rdf.engine.Nlp2RdfMetadataEngine.name=Apache Stanbol Enhancer Engine: \
-NLP data to RDF converter
+NLP data to NIF 1.0 converter
 
 
 stanbol.enhancer.engine.name.name=Name
@@ -24,3 +24,33 @@ used in the RESTful interface '/engine/<
 service.ranking.name=Ranking
 service.ranking.description=If two enhancement engines with the same name are active the \
 one with the higher ranking will be used to process parsed content items.
+
+
+org.apache.stanbol.enhancer.engines.nlp2rdf.engine.Nif20MetadataEngine.name=Apache Stanbol Enhancer Engine: \
+NLP data to NIF 2.0 converter
+org.apache.stanbol.enhancer.engines.nlp2rdf.engine.Nif20MetadataEngine.description=Engine \
+that converts NLP results stored in the AnalysedText content to NIF 2.0 compliant RDF. 
+
+enhancer.engines.nlp2rdf.previousNext.name=Previous and Next Links
+enhancer.engines.nlp2rdf.previousNext.description=If enabled previous and next links will be \
+written for Sentences and Words.
+
+enhancer.engines.nlp2rdf.selector.name=Write Selectors
+enhancer.engines.nlp2rdf.selector.description=If enabled beginIndex, endIndex, before and after \
+information are written for nif:String instances. If disabled no such information will be present \
+and clients will need to parse the resource URI of the nif:String to get such information.
+
+enhancer.engines.nlp2rdf.cotextOnlyUriScheme.name=Write URI Scheme only for the Context
+enhancer.engines.nlp2rdf.cotextOnlyUriScheme.description=If enabled the URI Scheme used to \
+create nif:String resource URIs will be only noted for the nif:Context instance. To get the \
+used URI scheme for other nif:String instance one needs to first lookup the reference context.
+
+enhancer.engines.nlp2rdf.writeStringType.name=Write nif:String type
+enhancer.engines.nlp2rdf.writeStringType.description=If enabled the nif:Sting type is \
+written for all such instances. If disabled the nif:String type is only added if their is \
+no more specific type (e.g. nif:Sentence, nif:Word) present.
+
+enhancer.engines.nlp2rdf.hierarchy.name=Write Hierarchy
+enhancer.engines.nlp2rdf.writeStringType.description=Switch that allows to enable/disable \
+writing of hierarchical links. This includes olia:sentence, olia:superString> and \
+olia:subString properties.