Author: tommaso
Date: Fri Feb 18 08:50:40 2011
New Revision: 1071923
URL: http://svn.apache.org/viewvc?rev=1071923&view=rev
Log:
[CLEREZZA-425] - added a coveredText property for annotations in UIMA
Ontologies, properly used the coveredText property in UIMAUtils removing the
unnecessary node
Modified:
incubator/clerezza/trunk/parent/uima/uima.ontologies/src/main/resources/org/apache/clerezza/uima/ontologies/entity.rdf
incubator/clerezza/trunk/parent/uima/uima.utils/src/main/java/org/apache/clerezza/uima/utils/UIMAUtils.java
Modified:
incubator/clerezza/trunk/parent/uima/uima.ontologies/src/main/resources/org/apache/clerezza/uima/ontologies/entity.rdf
URL:
http://svn.apache.org/viewvc/incubator/clerezza/trunk/parent/uima/uima.ontologies/src/main/resources/org/apache/clerezza/uima/ontologies/entity.rdf?rev=1071923&r1=1071922&r2=1071923&view=diff
==============================================================================
---
incubator/clerezza/trunk/parent/uima/uima.ontologies/src/main/resources/org/apache/clerezza/uima/ontologies/entity.rdf
(original)
+++
incubator/clerezza/trunk/parent/uima/uima.ontologies/src/main/resources/org/apache/clerezza/uima/ontologies/entity.rdf
Fri Feb 18 08:50:40 2011
@@ -60,6 +60,13 @@
<rdfs:range
rdf:resource="http://www.w3.org/2000/01/rdf-schema#Literal"/>
<rdfs:isDefinedBy
rdf:resource="http://clerezza.apache.org/2010/22/uima-entities"/>
</rdf:Property>
+
+ <rdf:Property
rdf:about="http://clerezza.apache.org/2010/22/uima-entities#coveredText"
vs:term_status="stable" rdfs:label="coveredText" skos:definition="The text span
between begin and end">
+ <rdf:type
rdf:resource="http://www.w3.org/2002/07/owl#DatatypeProperty"/>
+ <rdfs:domain
rdf:resource="http://clerezza.apache.org/2010/22/uima-entities#Annotation"/>
+ <rdfs:range
rdf:resource="http://www.w3.org/2000/01/rdf-schema#Literal"/>
+ <rdfs:isDefinedBy
rdf:resource="http://clerezza.apache.org/2010/22/uima-entities"/>
+ </rdf:Property>
<rdf:Property
rdf:about="http://clerezza.apache.org/2010/22/uima-entities#featureName"
vs:term_status="stable" rdfs:label="feature name" skos:definition="The name of
the feature.">
<rdf:type
rdf:resource="http://www.w3.org/2002/07/owl#DatatypeProperty"/>
Modified:
incubator/clerezza/trunk/parent/uima/uima.utils/src/main/java/org/apache/clerezza/uima/utils/UIMAUtils.java
URL:
http://svn.apache.org/viewvc/incubator/clerezza/trunk/parent/uima/uima.utils/src/main/java/org/apache/clerezza/uima/utils/UIMAUtils.java?rev=1071923&r1=1071922&r2=1071923&view=diff
==============================================================================
---
incubator/clerezza/trunk/parent/uima/uima.utils/src/main/java/org/apache/clerezza/uima/utils/UIMAUtils.java
(original)
+++
incubator/clerezza/trunk/parent/uima/uima.utils/src/main/java/org/apache/clerezza/uima/utils/UIMAUtils.java
Fri Feb 18 08:50:40 2011
@@ -98,16 +98,9 @@ public class UIMAUtils {
Annotation annotation = (Annotation) uimaObject;
annotationNode.addPropertyValue(ENTITY.begin, annotation.getBegin());
annotationNode.addPropertyValue(ENTITY.end, annotation.getEnd());
+
annotationNode.addPropertyValue(ENTITY.coveredText,annotation.getCoveredText());
- GraphNode coveredTextNode = new GraphNode(new UriRef(new
StringBuilder(ENTITY.Feature.getUnicodeString()).
- append(COVERED_TEXT.hashCode() /
uimaObject.hashCode()).toString()), annotationNode.getGraph());
- coveredTextNode.addPropertyValue(ENTITY.featureName, COVERED_TEXT);
- log.info(new StringBuilder("Node created for Feature
").append(COVERED_TEXT).toString());
- String coveredText = annotation.getCoveredText();
- coveredTextNode.addPropertyValue(ENTITY.featureValue, coveredText);
- log.info(new StringBuilder("Added feature
").append(COVERED_TEXT).append(" with value ")
- .append(coveredText).toString());
-
+ log.info(new StringBuilder("Added annotation properties to node
").append(uimaObject.toString()).toString());
}
//XXX : in OpenCalais the type is an URI so it maybe reasonable to put
another node here