Package org.apache.clerezza.rdf.core.impl

Examples of org.apache.clerezza.rdf.core.impl.SimpleMGraph


    }

    BNode resultResource = new BNode();
    MGraph contentGraph = cgProvider.getContentGraph();
   
    MGraph additionGraph = new SimpleMGraph();

    UnionMGraph resultGraph = new UnionMGraph(additionGraph, contentGraph);

    RdfList list = RdfList.createEmptyList(resultResource, additionGraph);
    resultGraph.add(new TripleImpl(resource,
View Full Code Here


  public GraphNode install() {

    AccessController.checkPermission(new ScriptManagerAppPermission());
    MGraph contentGraph = cgProvider.getContentGraph();
    BNode resultResource = new BNode();
    MGraph resultGraph = new SimpleMGraph();
    resultGraph.add(new TripleImpl(resultResource,
        RDF.type,
        SCRIPTMANAGER.ScriptManagerInstallPage));
    resultGraph.add(new TripleImpl(resultResource,
        RDF.type, PLATFORM.HeadedPage));
   
    GraphNode languageList = getScriptLanguageList(resultResource);
   
    GraphNode scriptList = getScriptList(resultResource);
View Full Code Here

   
    return new GraphNode(resultResource, unionGraph);
  }

  private GraphNode getScriptLanguageList(NonLiteral resource){
    MGraph resultGraph = new SimpleMGraph();
    Iterator<ScriptLanguageDescription> it =
        scriptExecution.getInstalledScriptLanguages();
    while(it.hasNext()){
      BNode languageDescription = new BNode();
      ScriptLanguageDescription sld = it.next();
      resultGraph.add(new TripleImpl(resource,
          SCRIPTMANAGER.scriptLanguageDescription,
          languageDescription));

      resultGraph.add(new TripleImpl(languageDescription,
          SCRIPT.scriptLanguage,
          LiteralFactory.getInstance().
          createTypedLiteral(sld.getLanguage())));
      resultGraph.add(new TripleImpl(languageDescription,
          SCRIPT.scriptLanguageVersion,
          LiteralFactory.getInstance().
          createTypedLiteral(sld.getVersion())));
    }
    return new GraphNode(resource, resultGraph);
View Full Code Here

  @Path("execution-uri-overview")
  public GraphNode getExecutionUriOverview() {
    AccessController.checkPermission(new ScriptManagerAppPermission());
    MGraph contentGraph = cgProvider.getContentGraph();
    BNode resultResource = new BNode();
    MGraph resultGraph = new SimpleMGraph();
    resultGraph.add(new TripleImpl(resultResource,
        RDF.type,
        PLATFORM.HeadedPage));
    resultGraph.add(new TripleImpl(resultResource,
        RDF.type,
        SCRIPTMANAGER.ExecutionUriOverviewPage));
    GraphNode scriptList = getScriptList(resultResource);
   
    UnionMGraph unionGraph = new UnionMGraph(resultGraph,
View Full Code Here

  @Produces("text/plain")
  public GraphNode getExecutionUris(
      @QueryParam(value = "script") UriRef script){
    AccessController.checkPermission(new ScriptManagerAppPermission());
    BNode resultResource = new BNode();
    MGraph resultGraph = new SimpleMGraph();
    Iterator<NonLiteral> executionUris =
        getScriptGeneratedResources(script).iterator();
    while(executionUris.hasNext()){
      resultGraph.add(new TripleImpl(resultResource,
          SCRIPTMANAGER.executionUri,
          executionUris.next()));
    }
    resultGraph.add(new TripleImpl(resultResource,
        SCRIPTMANAGER.script,
        script));
    resultGraph.add(new TripleImpl(resultResource,
        RDF.type,
        SCRIPTMANAGER.ExecutionUriList));
   
    return new GraphNode(resultResource, new UnionMGraph(resultGraph,
        cgProvider.getContentGraph()));
View Full Code Here

   * @return the graph read from the stream
   * @throws UnsupportedFormatException
   */
  public Graph parse(InputStream serializedGraph,
      String formatIdentifier, UriRef baseUri) throws UnsupportedFormatException {
    MGraph mGraph = new SimpleMGraph();
    parse(mGraph, serializedGraph, formatIdentifier, baseUri);
    return mGraph.getGraph();
  }
View Full Code Here

    this.renderingSpecification = renderingSpecification;
  }

  @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;
View Full Code Here

  protected final UriRef otherGraphUriRef = new UriRef(graphUriRef.getUnicodeString());

  @Test
  public void testCreateGraph() {
    TcProvider simpleTcmProvider = getInstance();
    MGraph mGraph = new SimpleMGraph();
    mGraph.add(new TripleImpl(uriRefA, uriRefA, uriRefA));

    Graph createdGraph = simpleTcmProvider.createGraph(uriRefA, mGraph);

    Iterator<Triple> iteratorInput = mGraph.iterator();
    Iterator<Triple> iteratorCreated = createdGraph.iterator();
    assertEquals(iteratorInput.next(), iteratorCreated.next());
    assertFalse(iteratorCreated.hasNext());

    try {
View Full Code Here

  @Test
  public void testGetGraph() {
    TcProvider simpleTcmProvider = getInstance();
    // add Graphs
    MGraph mGraph = new SimpleMGraph();
    mGraph.add(new TripleImpl(uriRefA, uriRefA, uriRefA));
    simpleTcmProvider.createGraph(uriRefA, mGraph);
    mGraph = new SimpleMGraph();
    mGraph.add(new TripleImpl(uriRefA1, uriRefA1, uriRefA1));
    simpleTcmProvider.createGraph(uriRefA1, mGraph);
    mGraph = new SimpleMGraph();
    mGraph.add(new TripleImpl(uriRefB, uriRefB, uriRefB));
    simpleTcmProvider.createGraph(uriRefB, mGraph);
    mGraph = new SimpleMGraph();
    mGraph.add(new TripleImpl(uriRefB1, uriRefB1, uriRefB1));
    simpleTcmProvider.createGraph(uriRefB1, mGraph);

    Graph bGraph = simpleTcmProvider.getGraph(uriRefB);
    Iterator<Triple> iterator = bGraph.iterator();
    assertEquals(new TripleImpl(uriRefB, uriRefB, uriRefB), iterator.next());
View Full Code Here

  @Test
  public void testGetTriples() {
    TcProvider simpleTcmProvider = getInstance();
    // add Graphs
    MGraph mGraph = new SimpleMGraph();
    mGraph.add(new TripleImpl(uriRefA, uriRefA, uriRefA));
    simpleTcmProvider.createGraph(uriRefA, mGraph);
    mGraph = new SimpleMGraph();
    mGraph.add(new TripleImpl(uriRefB, uriRefB, uriRefB));
    simpleTcmProvider.createGraph(uriRefB, mGraph);
    // add MGraphs
    mGraph = simpleTcmProvider.createMGraph(uriRefA1);
    mGraph.add(new TripleImpl(uriRefA1, uriRefA1, uriRefA1));
    mGraph = simpleTcmProvider.createMGraph(uriRefB1);
    mGraph.add(new TripleImpl(uriRefB1, uriRefB1, uriRefB1));

    // get a Graph
    TripleCollection tripleCollection = simpleTcmProvider.getTriples(uriRefA);
    // get a MGraph
    TripleCollection tripleCollection2 = simpleTcmProvider.getTriples(uriRefB1);
View Full Code Here

TOP

Related Classes of org.apache.clerezza.rdf.core.impl.SimpleMGraph

Copyright © 2018 www.massapicom. 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.