Package org.apache.clerezza.rdf.utils

Examples of org.apache.clerezza.rdf.utils.GraphNode.addPropertyValue()


        // set Annotation specific properties for the node
        if (uimaObject instanceof Annotation) {
          Annotation annotation = (Annotation) uimaObject;
          String coveredText = annotation.getCoveredText();
          annotationNode.addPropertyValue(ENTITY.coveredText, coveredText);
          log.info(new StringBuilder("Node wraps Annotation with coveredText:").append(coveredText).toString());
        }

        //XXX : in OpenCalais the type is an URI so it maybe reasonable to put another node here
        annotationNode.addPropertyValue(ENTITY.uimaType, uimaObject.getType().getName());
View Full Code Here


          annotationNode.addPropertyValue(ENTITY.coveredText, coveredText);
          log.info(new StringBuilder("Node wraps Annotation with coveredText:").append(coveredText).toString());
        }

        //XXX : in OpenCalais the type is an URI so it maybe reasonable to put another node here
        annotationNode.addPropertyValue(ENTITY.uimaType, uimaObject.getType().getName());

        /* inspect features of the annotation */
        Type type = uimaObject.getType();
        for (Feature feature : type.getFeatures()) {

View Full Code Here

          GraphNode featureNode = new GraphNode(new UriRef(new StringBuilder(ENTITY.Feature.getUnicodeString()).
                  append(feature.hashCode() / uimaObject.hashCode()).toString()), annotationNode.getGraph());
          log.info(new StringBuilder("Node created for Feature ").append(feature.getName()).toString());

          // set feature name and value if not null
          featureNode.addPropertyValue(ENTITY.featureName, feature.getName());

          String featureValue = null;
          try {
            featureValue = uimaObject.getFeatureValueAsString(feature);
          } catch (CASRuntimeException sofaEx) {
View Full Code Here

                      append(sofaEx.toString()).append(")").toString());
            }
          }

          if (featureValue != null) {
            featureNode.addPropertyValue(ENTITY.featureValue, featureValue);
            log.info(new StringBuilder("Added feature ").append(feature.getName()).append(" with value ")
                    .append(featureValue.toString()).toString());
          }

          // add feature to the annotation node
View Full Code Here

                AO.Selector);
        selectorNode.addProperty(new UriRef("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"),
                AOSELECTORS.OffsetRangeTextSelector);
        selectorNode.addProperty(new UriRef("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"),
                AOSELECTORS.PrefixPostfixTextSelector);
        selectorNode.addPropertyValue(AOSELECTORS.exact, getSpan(documentText, sel.start, sel.end));
        selectorNode.addPropertyValue(AOSELECTORS.prefix,
                getSpan(documentText, sel.start - 50, sel.start));
        selectorNode.addPropertyValue(AOSELECTORS.postfix,
                getSpan(documentText, sel.end, sel.end + 50));
        selectorNode.addPropertyValue(AOSELECTORS.offset, sel.start);
View Full Code Here

        selectorNode.addProperty(new UriRef("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"),
                AOSELECTORS.OffsetRangeTextSelector);
        selectorNode.addProperty(new UriRef("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"),
                AOSELECTORS.PrefixPostfixTextSelector);
        selectorNode.addPropertyValue(AOSELECTORS.exact, getSpan(documentText, sel.start, sel.end));
        selectorNode.addPropertyValue(AOSELECTORS.prefix,
                getSpan(documentText, sel.start - 50, sel.start));
        selectorNode.addPropertyValue(AOSELECTORS.postfix,
                getSpan(documentText, sel.end, sel.end + 50));
        selectorNode.addPropertyValue(AOSELECTORS.offset, sel.start);
        selectorNode.addPropertyValue(AOSELECTORS.range, sel.end);
View Full Code Here

        selectorNode.addProperty(new UriRef("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"),
                AOSELECTORS.PrefixPostfixTextSelector);
        selectorNode.addPropertyValue(AOSELECTORS.exact, getSpan(documentText, sel.start, sel.end));
        selectorNode.addPropertyValue(AOSELECTORS.prefix,
                getSpan(documentText, sel.start - 50, sel.start));
        selectorNode.addPropertyValue(AOSELECTORS.postfix,
                getSpan(documentText, sel.end, sel.end + 50));
        selectorNode.addPropertyValue(AOSELECTORS.offset, sel.start);
        selectorNode.addPropertyValue(AOSELECTORS.range, sel.end);
      }
View Full Code Here

        selectorNode.addPropertyValue(AOSELECTORS.exact, getSpan(documentText, sel.start, sel.end));
        selectorNode.addPropertyValue(AOSELECTORS.prefix,
                getSpan(documentText, sel.start - 50, sel.start));
        selectorNode.addPropertyValue(AOSELECTORS.postfix,
                getSpan(documentText, sel.end, sel.end + 50));
        selectorNode.addPropertyValue(AOSELECTORS.offset, sel.start);
        selectorNode.addPropertyValue(AOSELECTORS.range, sel.end);
      }

      TripleCollection tc = node.getGraph();
      for (Triple t : tc) {
View Full Code Here

        selectorNode.addPropertyValue(AOSELECTORS.prefix,
                getSpan(documentText, sel.start - 50, sel.start));
        selectorNode.addPropertyValue(AOSELECTORS.postfix,
                getSpan(documentText, sel.end, sel.end + 50));
        selectorNode.addPropertyValue(AOSELECTORS.offset, sel.start);
        selectorNode.addPropertyValue(AOSELECTORS.range, sel.end);
      }

      TripleCollection tc = node.getGraph();
      for (Triple t : tc) {
        log.info(t.toString());
View Full Code Here

      throws IOException {
    AccessController.checkPermission(new LoggingManagerAccessPermission());
    TrailingSlash.enforcePresent(uriInfo);
    SimpleMGraph resultMGraph = new SimpleMGraph();
    GraphNode result = new GraphNode(new BNode(), resultMGraph);
    result.addPropertyValue(LOGGING.loggingConfig, getPropertiesAsString());
    result.addProperty(RDF.type, PLATFORM.HeadedPage);
    result.addProperty(RDF.type, LOGGING.LoggingConfigPage);
    return result;
  }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.