NIF 2.1 Core Ontology
The NLP Interchange Format (NIF) is an RDF/OWL-based format that aims to achieve interoperability between Natural Language Processing (NLP) tools, language resources and annotations. NIF consists of specifications, ontologies and software, which are combined under the version identifier "2.1", but are versioned individually. This ontology is developed by the NLP2RDF project (http://nlp2rdf.org) and provided as part of NIF 2.1 under CC-BY license as well as Apache 2.0. The ontology contains seven core URIs (String, OffsetBasedString, Context, isString, referenceContext, beginIndex, endIndex) that provide the foundation to express NLP annotations effectively in RDF.
This ontology is licensed under Apache 2.0 (http://www.apache.org/licenses/LICENSE-2.0) and CC-BY (http://creativecommons.org/licenses/by/3.0/)
For a more concise description about NIF, we refer the reader to the ISWC 2013 in Use paper: Integrating NLP using Linked Data by Sebastian Hellmann, Jens Lehmann, Sören Auer, and Martin Brümmer available at: http://svn.aksw.org/papers/2013/ISWC_NIF/public.pdf Also the NLP2RDF project page (http://nlp2rdf.org) provides more general documentation and pointers. The NIF 2.1 Core Ontology (http://persistence.uni-leipzig.org/nlp2rdf/ontologies/nif-core#) provides classes and properties to describe the relations between substrings, text, documents by assigning URIs to strings. These URIs can then be used as subjects in RDF triples and therefore they can be annotated easily. The NIF 2.1 Core Specification defines how such URIs are created and used: http://persistence.uni-leipzig.org/nlp2rdf/specification/core.html and it makes sense to read this document first, so you can understand the definitions in this ontology better. The main class in this ontology is nif:String, which is the class of all words over the alphabet of Unicode characters (sometimes called Σ∗). We built NIF upon the Unicode Normalization Form C, as this follows the recommendation of the RDF standard for rdf:Literal. Indices are to be counted in code units as is common in most programming language and SPARQL engines ( see 17.4.3.2 STRLEN and 17.4.3.3 SUBSTR on http://www.w3.org/TR/sparql11-query/). Each URI Scheme (nif:URIScheme) used to address strings is a subclass of nif:String and puts further restrictions over the syntax of the URIs. Users of NIF can create their own URI schemes by subclassing nif:String and providing documentation on the Web in the rdfs:comment field. Another important subclass of nif:String is the nif:Context OWL class. This class is assigned to the whole string of the text (i.e. all characters). The purpose of an individual of this class is special, because the string of this individual is used to calculate the indices for all substrings. Therefore, all substrings have to have a relation nif:referenceContext pointing to an instance of nif:Context. Furthermore, the datatype property nif:isString can be used to include the reference text as a literal within the RDF as is required for the web service scenario. An example of NIF Core can be seen on the top left of the example Figure. Additional Resources The project also provides serveral additional resources: * various NIF representations of corpora * different demos for NIF Webservices and a NIF Web Service Combinator * a validation service for NIF RDF documents * a draft of a Stanbol Profile Specification Please find references to these (and other) resources in the NIF Dashboard: http://dashboard.nlp2rdf.aksw.org/ Feedback If you'd like to leave feedback, please open an issue on GitHub (https://github.com/NLP2RDF/ontologies/issues) and read the README (https://github.com/NLP2RDF/ontologies#readme) or write an email to the mailing list: http://lists.informatik.uni-leipzig.de/mailman/listinfo/nlp2rdf Versioning process is explained here: http://persistence.uni-leipzig.org/nlp2rdf/specification/version.html Changelog is written to rdfs:comment (resource level versioning).
String
Individuals of this class are a string, i.e. Unicode characters, who have been given a URI and are used in the subject of an RDF statement. This class is abstract and should not be serialized. NIF-Stanbol (nif-stanbol.ttl): The class is similar to fise:TextAnnotation
Context
The string that serves as a context for its substrings. The Unicode String given in the nif:isString or the content obtained by dereferencing nif:contextStringRef property must be used to calculate the begin and endIndex for all nif:Strings that have a nif:referenceContext property to this URI. For further information, see http://svn.aksw.org/papers/2013/ISWC_NIF/public.pdf
external context reference
Provides the reference to a location where the text for a Context can be retrieved in case it cannot be embedded via isString directly due to licence restrictions or similar reasons. This allow a pure 'stand-off' paradigm for text annotations with NIF. The content obtained by dereferencing the provided URI MUST be just the plain Unicode text data and SHOULD be in NFC as equivalent for the string literal that would be otherwise provided directly by nif:isString.
reference context
Links a URI of a string to its reference context of type nif:Context. The reference context determines the calculation of begin and end index Each String that is not an instance of nif:Context MUST have exactly one reference context. Inferences (nif-core-inf.ttl): Instances of nif:Context do have itself as reference context, this is inferred automatically, MAY be materialized, as well. OWL validation (nif-core-val.ttl): This property is functional.
is string
The reference text as rdf:Literal for this nif:Context resource. NIF requires that the reference text (i.e. the context) is always included in the RDF as an rdf:Literal. Note, that the isString property is *the* place to keep the string itself in RDF. All other nif:Strings and nif:URISchemes relate to the text of this property to calculate character position and indices.
begin index
The begin index of a character range as defined in http://tools.ietf.org/html/rfc5147#section-2.2.1 and http://tools.ietf.org/html/rfc5147#section-2.2.2, measured as the gap between two characters, starting to count from 0 (the position before the first character of a text). Example: Index "2" is the position between "Mr" and "." in "Mr. Sandman"@en. Note: RFC 5147 is re-used for the definition of character ranges. RFC 5147 is assuming a text/plain MIME type. NIF builds upon Unicode and is content agnostic. Requirement (1): This property has the same value the "Character position" of RFC 5147 and it MUST therefore be castable to xsd:nonNegativeInteger, i.e. it MUST not have negative values. Requirement (2): The index of the subject string MUST be calculated relative to the nif:referenceContext of the subject. If available, this is the rdf:Literal of the nif:isString property.
end index
The end index of a character range as defined in http://tools.ietf.org/html/rfc5147#section-2.2.1 and http://tools.ietf.org/html/rfc5147#section-2.2.2, measured as the gap between two characters, starting to count from 0 (the position before the first character of a text). Example: Index "2" is the position between "Mr" and "." in "Mr. Sandman". Note: RFC 5147 is re-used for the definition of character ranges. RFC 5147 is assuming a text/plain MIME type. NIF builds upon Unicode and is content agnostic. Requirement (1): This property has the same value the "Character position" of RFC 5147 and it must therefore be castable to xsd:nonNegativeInteger, i.e. it MUST not have negative values. Requirement (2): The index of the subject string MUST be calculated relative to the nif:referenceContext of the subject. If available, this is the rdf:Literal of the nif:isString property.
anchor of
The string, which the URI is representing as an RDF Literal. Some use cases require this property, as it is necessary for certain sparql queries.
URI Scheme
A URI Scheme for NIF, subclasses need to define guidelines on the URI Scheme as well as the text it refers to. This class is just to keep some order, and should not be serialized. This is an abstract class and should not be serialized.
Consecutive String
A URI Scheme for NIF which is able to refer to a single, consecutive string in a context. Note that any scheme subclassing this class, requires the existence of beginIndex, endIndex and referenceContext . This is an abstract class and should not be serialized.
Structure
A structure is a more or less arbitrary label for a partitioning of a string. We do not follow a strict approach for what a word, phrase, sentence, title, paragraph is. These labels enable the definition processes for tool chains, e.g. tool analyses nif:Paragraph and calculates term frequency. This is an abstract class and should not be serialized.
Annotation
NIF String that also either carries annotation property assertions (see nif:PropertyBasedAnnotation) or mark implicitly of a text spans themselves (see nif:TextSpanAnnotation).
PropertyAssertionAnnotation
Annotation for text spans expressed using a property assertion.
TextSpanAnnotation
Subclasses of nif:TextSpanAnnotations implicitly highlight text spans to mark them as a certain occurrence.
objectAnnotation
see Towards Web-Scale Collaborative Knowledge Extraction http://svn.aksw.org/papers/2012/PeoplesWeb/public_preprint.pdf page 21 .
former identifier for nif:objectAnnotation
literalAnnotation
classAnnotation
ancestor property for annotation properties that refer to OWL classes (using OWL 2 punning). see Towards Web-Scale Collaborative Knowledge Extraction http://svn.aksw.org/papers/2012/PeoplesWeb/public_preprint.pdf page 12 .
source URL
The URL the context was extracted from, e.g. the blog or news article url. Doesn't matter whether it is HTML or XML or plain text. rdfs:range is foaf:Document. Subproperty of prov:hadPrimarySource. In case the string comes from another NIF String and gives the exact provenance, please use nif:wasConvertedFrom or a subProperty thereof.
was converted from
This property should be used, when mapping one nif:String or nif:Context to another and is often confused with nif:sourceUrl. While nif:sourceUrl is built on PROV-O and is used to link the nif:Context to the document URL for provenance information, nif:convertedFrom is more precise and pinpoints exact locations where a certain NIF String "wasConvertedFrom". nif:wasConvertedFrom is therefore used to provide *exact* provenance during a conversion process, e.g. when removing tags from XHTML and then linking XPath URIs to NIF index based URIs (e.g. RFC 5147 with char=x,y). An example of the usage of this property can be found here: http://www.w3.org/TR/its20/#conversion-to-nif Example # "Dublin" <http://example.com/myitsservice?informat=html&intype=url&input=http://example.com/doc.html&char=11,17> nif:wasConvertedFrom <http://example.com/myitsservice?informat=html&intype=url&input=http://example.com/doc.html&xpath=/html/body[1]/h2[1]/span[1]/text()[1]>.
Context Collection
A collection of contexts used to create an unordered set of context via the nif:hasContext property. This can be compared to a document collection, but here it is a collection of nif:Context and therefore a collection of annotated strings, not documents. Open Issues Investigate ordered collections
has context
Links a nif:ContextCollection to its contexts.
inter
This object property models a relation between two nif:Strings. The name "inter" is kept generic and can be used to express any kind of relation in between (inter) two nif:Strings. Extensions can create rdfs:subPropertyOf for "head", "dependent", nif:substring and nif:nextWord.
broader context
This property should be used to express that one Context is contained in another Context, e.g. several sentences of a document are modelled indivudally and refer to the broader context of the whole document.
narrower context
The inverse of nif:narrowerContext
before
For each string you can include a snippet (e.g. 10-40 characters of text), that occurs immediately before the subject string.
after
For each string you can include a snippet (e.g. 10-40 characters of text), that occurs immediately after the subject string.
head
The first few chars of the nif:anchorOf. Typically used if the nif:anchorOf is to long for inclusion as RDF literal.
tail
The last few chars of the nif:anchorOf. Typically used if the nif:anchorOf is to long for inclusion as RDF literal.
contextAsLiteral
The string that the nif:anchorOf is embedded in. FILTER ( strlen (nif:referenceContext [ nif:isString ] ) )
predominant language
Defines the predominant language of the text. If this annotation is given on a nif:Context, all NIF tools have to treat the text to be in this language unless specified differently for a subpart. To change the language for a smaller substring nif:lang must be used. This property requires a uri as an argument. We expect this to be a URI from the lexvo.org namespace, e.g. http://lexvo.org/id/iso639-3/eng using ISO639-3 Examples "The dealer says: "Rien ne va plus!" " has nif:predLang http://lexvo.org/id/iso639-3/eng and nif:lang http://www.lexvo.org/id/iso639-3/fra see also: http://www.w3.org/TR/its20/#selection-local Tests for RDFUnit (not written yet): - write a test for RDFUnit, so people do not use http://www.lexvo.org/page/iso639-3/eng
language of the string
Defines the language of a substring of the context. If the language for the nif:Context should be specified, nif:predLang must be used. see nif:predLang for more info.
Consecutive String Instantiation
An abitrary URI (e.g. a URN) for an arbitrary string of the context. This is roughly the same as TextAnnotations are currently implemented in Stanbol.
Context Hash Based String
cf. https://www.google.de/search?q=Linked-Data+Aware+URI+Schemes+for+Referencing+Text
Offset-based String
cf. Linked-Data Aware URI Schemes for Referencing Text Fragments by Sebastian Hellmann, Jens Lehmann und Sören Auer in EKAW 2012 http://jens-lehmann.org/files/2012/ekaw_nif.pdf requires the existence of begin, endIndex and referenceContext
RFC 5147 String
cf. http://tools.ietf.org/html/rfc5147 URIs of this class have to conform with the syntax of RFC 5147 in a way that the end on a valid identifier, if you remove the prefix. Note that unlike RFC 5147 NIF does not requrire '#' URIs. So valid URIs are http://example.org#char=0,28 , http://example.org/whatever/char=0,28 , http://example.org/nif?char=0,28 Further use of this class is discouraged, since text positions according to RFC 5147 differs from Unicode character counts used by NIF when newlines occur in the source text.
Word
The Word class represents strings that are tokens or words. A string is a Word, if it is a word. We don't nitpic about whether it is a a pronoun, a name, a punctuation mark or an apostrophe or whether it is separated by white space from another Word or something else. The string 'He enters the room.' for example has 5 words. Words are assigned by a tokenizer NIF Implementation. Single word phrases might be tagged as nif:Word and nif:Phrase. Example 1: "The White House" are three Words separated by whitespace Comment 1: We adopted the definition style from foaf:Person, see here: http://xmlns.com/foaf/spec/#term_Person We are well aware that the world out there is much more complicated, but we are ignorant about it, for the following reasons: Comment 2: 1. NIF has a client-server and the client has the ability to dictate the tokenization to the server (i.e. the NIF Implementation) by sending properly tokenized NIF annotated with nif:Word. All NIF Implementations are supposed to honor and respect the current assignment of the Word class. Thus the client should decide which NIF Implementation should create the tokenization. Therefore this class is not descriptive, but prescriptive. 2. The client may choose to send an existing tokenization to a NIF Implementation, with the capability to change (for better or for worse) the tokenization. The class has not been named 'Token' as the NLP definition of 'token' is descriptive (and not well-defined), while the assignment of what is a Word and what not is prescriptive, e.g. "can't" could be described as one, two or three tokens or defined as being one, two or three words. For further reading, we refer the reader to: By all these lovely tokens... Merging conflicting tokenizations by Christian Chiarcos, Julia Ritz, and Manfred Stede. Language Resources and Evaluation 46(1):53-74 (2012) or the short form: http://www.aclweb.org/anthology/W09-3005 There the task at hand is to merge two tokenization T_1 and T_2 which is normally not the case in the NIF world as tokenization is prescribed, i.e. given as a baseline (Note that this ideal state might not be achieved by all implementations.)
Phrase
A nif:Phrase can be a nif:String, that is a chunk of several words or a word itself (e.g. a NounPhrase as a Named Entity). The term is underspecified and can be compatible with many defintitions of phrase. Please subClass it to specify the meaning (e.g. for Chunking or Phrase Structure Grammar). Example: ((My dog)(also)(likes)(eating (sausage)))
Sentence
A sentence.
Paragraph
A paragraph.
Title
A title within a text.
sub string
This property together with nif:subString, nif:superString, and their transitive extension can be used to express that one string is contained in another one. Examples: "a" nif:subString "apple" , "apple" nif:subString "apple". The transitivity axioms are included in nif-core-inf.ttl and need to be included separately to keep a low reasoning profile. They are modeled after skos:broader and skos:broaderTransitive
transitive version of subString
transitive version of subString Inferences (nif-core-inf.ttl): Transitive definition kept in a different ontology
super String
see nif:subString
transitive version of superString
see nif:subStringTrans
This property (and nif:previousSentence, nif:nextWord, nif:previousWord and their transitive extension) can be used to make resources of nif:Sentence and nif:Word traversable, it can not be assumed that no gaps or whitespaces between sentences or words exist, i.e. string adjacency is not mandatory. The transitivity axioms are included in nif-core-inf.ttl and need to be included separately to keep a low reasoning profile. They are modeled after skos:broader and skos:broaderTransitive
see nif:nextSentence
has word
This property links sentences to their words.
has first word
This property links sentences to their first word.
has last word
This property links sentences to their last word.
This property links words and other structures to their sentence.
lemma
The lemma(s) of the nif:String.
stem
The stem(s) of the nif:String.
OLiA link
This property links a string to a URI from one of the OLiA Annotation model, e.g. http://purl.org/olia/penn.owl#NNP
OLiA Category
This property links a string URI to classes of the OLiA Reference model. It provides a direct link for querying, thus it is a redundant optimization.
Confidence of OLiA tag
The confidence is relative to the tool and can be between 0.0 and 1.0, it is for nif:oliaLink and therefore also for nif:oliaCategory.
Provenance of OLiA annotation
Links to the URI describing the provenance
Part of speech tag
To include the pos tag as it comes out of the NLP tool as RDF Literal. This property is discouraged to use alone, please use oliaLink and oliaCategory. We included it, because some people might still want it and will even create their own property, if the string variant is missing
category
A simple annotation for machine learning purposes. The object can be anything, e.g. the literal "A. PRESS: Reportage" from Brown or any URI. ChangeLog:
dependency
A dependency relation pointing from gov to dep.
dependency relation type
String denoting the kind of dependency relation
transitive version of dependency
sentiment value
Between -1 negative and 1 positive
opinion
This property is used to link to a marl:Opinion. We have not investigated marl, so it might be replaced. http://marl.gi2mo.org/?page_id=1#overview . InverseOf marl:extractedFrom
Translation
A context representing string data for a translation in a target language obtained by a tranlation process (both manually or (semi-)automatically) of a nif:String.
Links from a context representing a translation to the nif:String with the corresponding string in the source language.
translation of
Links from a nif:String to a nif:Translation context representing a language equivalent/translation in a specific target language
translationProv
translationConf
topic
The topic of a string
keyword
A general keyword associated with a string
EntityOccurrence
Text span annotation denoting that a word or phrase has been detected as occurrence of a named entity. (Use this without further annotation property assertions if you just want to express the detection of the occurrence when neither the mentioned entity nor its category was identified.)
entity occurrence confidence (companion property)
entity occurrence provenance (companion property)
TermOccurrence
Text span annotation denoting that a word or phrase has been detected as occurrence of a term. (Use this without further annotation property assertions if you just want to express the detection of the occurrence when neither the mentioned entity nor its category was identified.)
term occurrence confidence (companion property) Taking semantics of itsrdf:termConfidence into regard individually, one could see this property as a sub-property of it. However, since ITS normatively demands a corresponding itsrdf:termAnnotatorsRef for each occurrence of itsrdf:termConfidence on the one hand with no corrensponding strict 'confidence implies provenance' policy in NIF on the other, no formal rdfs:subPropertyOf assertion is declared due to this slight mismatch in the properties semantics.
term occurrence provenance (companion property) This is property specialises itsrdf:termAnnotatorsRef with regard to domain and range.
AnnotationUnit
Individuals of this class group unambiguously a set of annotation assertions (either by a property assertion or an implicit annoation via nif:TextSpanAnnotation). A typical use case to introcude annotation sets is provision of provenance and/or confidence information for multiple statements for the same kind of annoation information (e.g. several itsrdf:taIdentRef assertions) in an unambiguous manner.
annotationUnit
Links a nif:String to nif:AnnotationUnit.
provenance
Provenance of an annotation, specified either a complete activity description capturing the agent, used entities and the time (preferred) or just the agent that creted the annotation (e.g. a human annotator or an NLP service).
confidence
Confidence of an annotation as decimal between 0 and 1
provenance companion property
Abstract provenance property for companion properties to express provenance. Values specify either a complete activity description capturing the agent, used entities and the time (preferred) or just the agent that creted the annotation (e.g. a human annotator or an NLP service). Usage Note: in order to use this property, you need to create a new property which is a rdfs:subPropertyOf nif:confidenceCompanion. This subproperty may follow the naming pattern "${targetproperty}Prov". The following statements give a usage example: nif:oliaProv rdfs:subPropertyOf nif:provenanceCompanion . nif:oliaLink nif:provenanceProperty nif:oliaProv .
confidence companion
Abstract confidence property for companion properties to express confidence. Values must be decimal between 0 and 1 inclusive. Usage Note: in order to use this property, you need to create a new property which is a rdfs:subPropertyOf nif:confidenceCompanion. This subproperty may follow the naming pattern "${targetproperty}Conf". The following statements give a usage example: nif:oliaConf rdfs:subPropertyOf nif:confidenceCompanion . nif:oliaLink nif:confidenceProperty nif:oliaConf .
provenance property
Declares a companion provenance property for a property used for annotation or a subclass of nif:TextSpanAnnotation. Establishing this vocabluary meta-information explicity allows creating tool that can consume and validate NIF more effectively. The domain of this property is a (punned) subclass of nif:TextSpanAnnotation or a (punned) object or datatype property. The range of this property is a (punned) property (usually a sub-property of nif:provenanceCompanion).
confidence property
Declares a companion confidence property for a property used for annotation or a subclass of nif:TextSpanAnnotation. Establishing this vocabluary meta-information explicity allows creating tool that can consume and validate NIF more effectively. The domain of this property is a (punned) subclass of nif:TextSpanAnnotation or a (punned) object or datatype property. The range of this property is a (punned) property (usually a sub-property of nif:confidenceCompanion).
text analysis identity reference confidence (companion property) This property is closely related to itstdf:taConfidence, but only refers to the confidence of the link to a concrete entity.
text analysis identity reference provenance (companion property) This property is closely related to itstdf:taAnnotatorsRef, but only refers to the provenance of the link to a concrete entity.
text analysis entity type reference confidence (companion property) This property is closely related to itstdf:taConfidence, but only refers to the confidence of the categorisation into an entity type.
text analysis entity type reference provenance (companion property) This property is closely related to itstdf:taAnnotatorsRef, but only refers to the provenance of the categorisation into an entity type.
As itsrdf:taConfidence poses a common confidence measure, it implies :taIdentConf.
As itsrdf:taConfidence poses a common confidence measure, it implies :taClassConf.
terminology information reference confidence (companion property)
terminology information reference provenance (companion property)