Package org.apache.clerezza.rdf.core

Examples of org.apache.clerezza.rdf.core.MGraph


   
    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


      String scriptLanguageVersion, String mediaTypeString,
      String producedTypeString) {
    try {
      MediaType mediaType = MediaType.valueOf(mediaTypeString);

      MGraph contentGraph = cgProvider.getContentGraph();



      contentHandler.put(scriptUri, mediaType, scriptFileBytes);
View Full Code Here

          Status.BAD_REQUEST).entity(ex.getMessage()).build());
    }
  }

  private void deleteScript(UriRef scriptUri) {
    MGraph contentGraph = cgProvider.getContentGraph();
   
    contentHandler.remove(scriptUri);
    GraphNode scriptNode = new GraphNode(scriptUri, contentGraph);
    scriptNode.deleteProperty(RDF.type, SCRIPT.Script);
    scriptNode.deleteProperties(DCTERMS.title);
View Full Code Here

   *      true otherwise.
   */
  private boolean saveExecutionUri(String scriptExecutionUri,
      UriRef scriptUri) {

    MGraph contentGraph = cgProvider.getContentGraph();

    if (!scriptExecutionUri.equals("")) {
      UriRef generatedResourceUri = new UriRef(scriptExecutionUri);
      if (!contentGraph.filter(generatedResourceUri, RDF.type,
          SCRIPT.ScriptGeneratedResource).hasNext()) {
       
        GraphNode generatedResourceNode =
            new GraphNode(generatedResourceUri, contentGraph);
        generatedResourceNode.addProperty(RDF.type,
View Full Code Here

  @Path("overview")
  public GraphNode getHomePage(@Context UriInfo uriInfo) {

    TrailingSlash.enforceNotPresent(uriInfo);

    MGraph mGraph = new SimpleMGraph();
    NonLiteral overview = new BNode();
    mGraph.add(new TripleImpl(overview, RDF.type, DASHBOARD.DashBoard));
    mGraph.add(new TripleImpl(overview, RDF.type, PLATFORM.HeadedPage));
    return new GraphNode(overview, mGraph);
  }
View Full Code Here

   *
   * @param customfield
   * @return the property UriRef of the customfield
   */
  public UriRef getCustomFieldProperty(NonLiteral customfield){
    MGraph contentGraph = cgProvider.getContentGraph();
    return (UriRef)contentGraph.filter(customfield, CUSTOMPROPERTY.property,
        null).next().getObject();
  }
View Full Code Here

    return true;
  }

  private void deleteExecutionUri(NonLiteral scriptGeneratedResource,
      UriRef scriptUri) {
    MGraph contentGraph = cgProvider.getContentGraph();

    GraphNode generatedResourceNode =
        new GraphNode(scriptGeneratedResource, contentGraph);
    generatedResourceNode.deleteProperty(RDF.type,
        SCRIPT.ScriptGeneratedResource);
View Full Code Here

    Assert.assertEquals(retrievedTriple.getSubject(), retrievedTriple.getObject());
  }
 
  @Test
  public void testRemoveAllTriples() {
    MGraph graph = getEmptyMGraph();
    Assert.assertEquals(0, graph.size());
    graph.add(new TripleImpl(uriRef1, uriRef2, uriRef3));
    graph.add(new TripleImpl(uriRef2, uriRef3, uriRef4));
    Assert.assertEquals(2, graph.size());
    graph.clear();
    Assert.assertEquals(0, graph.size());
  }
View Full Code Here

   */
  @GET
  @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

TOP

Related Classes of org.apache.clerezza.rdf.core.MGraph

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.