Package org.apache.clerezza.rdf.utils

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


  @Override
  public GraphNode getExceptionGraphNode() {
    GraphNode result = new GraphNode(new BNode(), new SimpleMGraph());
    result.addProperty(RDF.type, TYPERENDERING.Exception);
    result.addProperty(TYPERENDERING.errorSource, new UriRef(renderingSpecification.toString()));
    result.addProperty(TYPERENDERING.message, new PlainLiteralImpl(getMessage()));
    result.addProperty(TYPERENDERING.stackTrace, getStackTraceLiteral());
    return result;
  }

  private PlainLiteral getStackTraceLiteral() {
View Full Code Here


  public GraphNode getExceptionGraphNode() {
    GraphNode result = new GraphNode(new BNode(), new SimpleMGraph());
    result.addProperty(RDF.type, TYPERENDERING.Exception);
    result.addProperty(TYPERENDERING.errorSource, new UriRef(renderingSpecification.toString()));
    result.addProperty(TYPERENDERING.message, new PlainLiteralImpl(getMessage()));
    result.addProperty(TYPERENDERING.stackTrace, getStackTraceLiteral());
    return result;
  }

  private PlainLiteral getStackTraceLiteral() {
    StringWriter sw = new StringWriter();
View Full Code Here

  @GET
  public GraphNode resetPage(@Context UriInfo uriInfo) {
    TrailingSlash.enforcePresent(uriInfo);
    GraphNode result = new GraphNode(new BNode(), new SimpleMGraph());
    result.addProperty(RDF.type, USERMANAGER.PasswordResetPage);
    return result;
  }

  @POST
  public Response reset(@FormParam("user") final String userName,
View Full Code Here

          MGraph temporary = new SimpleMGraph();
          temporary.add(new TripleImpl(agent, PERMISSION.password,
              new PlainLiteralImpl(newPassword)));
          MGraph result = new UnionMGraph(temporary, systemGraph);
          GraphNode mailGraph = new GraphNode(new BNode(), result);
          mailGraph.addProperty(RDF.type, USERMANAGER.PasswordResetMail);
          mailGraph.addProperty(USERMANAGER.recipient, agent);
          List<MediaType> acceptableMediaTypes =
          Collections.singletonList(MediaType.TEXT_PLAIN_TYPE);
          mailMan.sendEmailToUser(passwordUser, userName, "New Password",
          mailGraph, acceptableMediaTypes, null);
View Full Code Here

          temporary.add(new TripleImpl(agent, PERMISSION.password,
              new PlainLiteralImpl(newPassword)));
          MGraph result = new UnionMGraph(temporary, systemGraph);
          GraphNode mailGraph = new GraphNode(new BNode(), result);
          mailGraph.addProperty(RDF.type, USERMANAGER.PasswordResetMail);
          mailGraph.addProperty(USERMANAGER.recipient, agent);
          List<MediaType> acceptableMediaTypes =
          Collections.singletonList(MediaType.TEXT_PLAIN_TYPE);
          mailMan.sendEmailToUser(passwordUser, userName, "New Password",
          mailGraph, acceptableMediaTypes, null);
        } catch (MessagingException ex) {
View Full Code Here

              new StringBuilder(AO.AnnotationSet.getUnicodeString()).toString());
      log.info("AO: Annotation set uri " + annotationSetUri);

      GraphNode annotationSet = new GraphNode(annotationSetUri, node.getGraph());
      log.info(new StringBuilder("AO: Set created ").toString());
      annotationSet.addProperty(new UriRef("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"),
              AO.AnnotationSet);

      for (FeatureStructure uimaObject : UIMAUtils.getAllFSofType(TOP.type, cas.getJCas())) {

        // set Annotation specific properties for the node
View Full Code Here

          // Annotation Graph
          GraphNode annotationNode = new GraphNode(annotationUri, annotationSet.getGraph());
          log.info(new StringBuilder("AO: Node created for Type ").append(
                  uimaObject.getType().toString()).toString());
          annotationNode.addProperty(new UriRef("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"),
                  new UriRef("http://purl.org/ao/Annotation"));

          annotationNode.addProperty(AO.context, selectorUri);

          // finally add the triple to the existing node
View Full Code Here

          log.info(new StringBuilder("AO: Node created for Type ").append(
                  uimaObject.getType().toString()).toString());
          annotationNode.addProperty(new UriRef("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"),
                  new UriRef("http://purl.org/ao/Annotation"));

          annotationNode.addProperty(AO.context, selectorUri);

          // finally add the triple to the existing node
          annotationSet.addProperty(AO.item, annotationNode.getNode());
        }
      }
View Full Code Here

        // create a new feature node
        GraphNode selectorNode = new GraphNode(selectorUri, node.getGraph());
        log.info(new StringBuilder("Node created for Selector " + selectorUri).toString());

        String documentText = cas.getDocumentText();
        selectorNode.addProperty(new UriRef("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"),
                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);
View Full Code Here

        log.info(new StringBuilder("Node created for Selector " + selectorUri).toString());

        String documentText = cas.getDocumentText();
        selectorNode.addProperty(new UriRef("http://www.w3.org/1999/02/22-rdf-syntax-ns#type"),
                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,
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.