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

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


    AccessController.checkPermission(new UserManagerAccessPermission());
    AccessController.checkPermission(new PermissionManagerAccessPermission());
    TrailingSlash.enforceNotPresent(uriInfo);

    MGraph resultGraph = new SimpleMGraph();
    NonLiteral rolePermissionPage = new BNode();
    Iterator<PermissionDescripton> permDescs = permGatherer.getAllPermissionDescriptors();
    while(permDescs.hasNext()) {
      PermissionDescripton desc = permDescs.next();
      BNode providedPermission = new BNode();
      resultGraph.add(new TripleImpl(rolePermissionPage,
          USERMANAGER.permission, providedPermission));
      resultGraph.add(new TripleImpl(providedPermission,
          PERMISSION.javaPermissionEntry, new PlainLiteralImpl(desc.getJavaPermissionString())));
      resultGraph.add(new TripleImpl(providedPermission,
          DCTERMS.title, new PlainLiteralImpl(desc.getSimpleName())));
      resultGraph.add(new TripleImpl(providedPermission,
          DCTERMS.description, new PlainLiteralImpl(desc.getDescription())));
    }

    resultGraph.add(new TripleImpl(rolePermissionPage, RDF.type,
        PLATFORM.HeadedPage));
    resultGraph.add(new TripleImpl(rolePermissionPage, RDF.type,
        USERMANAGER.RolePermissionPage));

    NonLiteral role = userManager.getRoleByTitle(title);
    if (role != null) {
      resultGraph.add(new TripleImpl(rolePermissionPage,
          USERMANAGER.role, role));
      return new GraphNode(rolePermissionPage, new UnionMGraph(
          resultGraph, systemGraph));

    }
View Full Code Here


  @Path("add-property")
  public GraphNode getAddSinglePropertyPage(
      @QueryParam(value = "roleTitle") String role) {

    AccessController.checkPermission(new UserManagerAccessPermission());
    MGraph resultGraph = new SimpleMGraph();
    NonLiteral node = new BNode();
    resultGraph.add(new TripleImpl(node, RDF.type,
        USERMANAGER.AddCustomPropertyPage));
    resultGraph.add(new TripleImpl(node, RDF.type,
        PLATFORM.HeadedPage));

    resultGraph.add(new TripleImpl(node, USERMANAGER.role,
        new PlainLiteralImpl(role)));
    return new GraphNode(node, resultGraph);
  }
View Full Code Here

      @QueryParam(value = "role") String role, @Context UriInfo uriInfo) {
    TrailingSlash.enforceNotPresent(uriInfo);

    AccessController.checkPermission(new UserManagerAccessPermission());
    MGraph contentGraph = cgProvider.getContentGraph();
    MGraph resultGraph = new SimpleMGraph();
    NonLiteral propertyManagementPage = new BNode();
    resultGraph.add(new TripleImpl(propertyManagementPage,
        USERMANAGER.role, new PlainLiteralImpl(role)));
    resultGraph.add(new TripleImpl(propertyManagementPage, RDF.type,
        USERMANAGER.CustomFieldPage));
    resultGraph.add(new TripleImpl(propertyManagementPage, RDF.type,
        PLATFORM.HeadedPage));
    ArrayList<NonLiteral> customfields = customPropertyManager
        .getCustomfieldsOfCollection(customPropertyManager
            .getCustomPropertyCollection(PERMISSION.Role, role));
    for (NonLiteral customfield : customfields) {
      resultGraph.add(new TripleImpl(customfield, USERMANAGER.role,
          new PlainLiteralImpl(role)));
      resultGraph.add(new TripleImpl(propertyManagementPage,
          CUSTOMPROPERTY.customfield, customfield));
    }
    return new GraphNode(propertyManagementPage, new UnionMGraph(
        resultGraph, contentGraph));
  }
View Full Code Here

    final UriRef indexUri = new UriRef(uriString+"index");
    if (contentGraph.filter(indexUri, null, null).hasNext()) {
      return new GraphNode(indexUri, contentGraph);
    }
    final UriRef uri = new UriRef(uriString);
    MGraph mGraph = new UnionMGraph(new SimpleMGraph(), contentGraph);
    final GraphNode graphNode = new GraphNode(uri, mGraph);
    graphNode.addProperty(RDF.type, PLATFORM.HeadedPage);

    UriRef collectionUri = new UriRef(uriInfo.getAbsolutePath().toString());
    return graphNode;
View Full Code Here

  @Test
  public void replaceLiteral() throws Exception {
    File dataDir = File.createTempFile("test", "externalizer");
    dataDir.delete();
    dataDir.mkdir();
    ExternalizingMGraph graph = new ExternalizingMGraph(new SimpleMGraph(), dataDir);
    TypedLiteral lit = new TypedLiteralImpl("jkjkj", ExternalizingMGraph.base64Uri);
    UriRef replacement = graph.replace(lit);
    TypedLiteral reconstructed = graph.getLiteralForUri(replacement.getUnicodeString());
    Assert.assertEquals(replacement, graph.replace(reconstructed));
  }
View Full Code Here

  @Test
  public void base16Ints() throws Exception {
    File dataDir = File.createTempFile("test", "externalizer");
    dataDir.delete();
    dataDir.mkdir();
    ExternalizingMGraph graph = new ExternalizingMGraph(new SimpleMGraph(), dataDir);
    //int value = -1291264412;
    int value = -0x10;
    byte[] bytes = new byte[4];
    bytes[0] = (byte) (0xFF & (value >>> 24));
        bytes[1] = (byte) (0xFF & (value >>> 16));
View Full Code Here

    if (tcDir.exists()) {
      throw new EntityAlreadyExistsException(name);
    }

    if (triples == null) {
      triples = new SimpleMGraph();
    }
    tcDir.mkdirs();
    File otimizationIndicator = new File(tcDir, "fixed.opt");
    try {
      otimizationIndicator.createNewFile();
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

      @QueryParam(value = "script") UriRef script) {

    AccessController.checkPermission(new ScriptManagerAppPermission());
    MGraph contentGraph = cgProvider.getContentGraph();
    BNode resultResource = new BNode();
    MGraph resultGraph = new SimpleMGraph();
   
    GraphNode scriptNode = null;
    if(script != null){
      scriptNode = getScript(script);
      resultGraph.add(new TripleImpl(resultResource,
          SCRIPTMANAGER.script,
          scriptNode.getNode()));
    }
    resultGraph.add(new TripleImpl(resultResource,
        RDF.type,
        PLATFORM.HeadedPage));
    resultGraph.add(new TripleImpl(resultResource,
        RDF.type,
        SCRIPTMANAGER.ScriptManagerOverviewPage));
    GraphNode scriptList = getScriptList(resultResource);

    UnionMGraph unionGraph = null;
View Full Code Here

  public GraphNode getScript(
      @QueryParam(value = "script") UriRef scriptUri){

    AccessController.checkPermission(new ScriptManagerAppPermission());
    BNode resource = new BNode();
    MGraph resultGraph = new SimpleMGraph();


    resultGraph.add(new TripleImpl(resource,
        SCRIPTMANAGER.script,
        scriptUri));
    resultGraph.add(new TripleImpl(resource,
        RDF.type,
        SCRIPTMANAGER.SelectedScript));
    resultGraph.add(new TripleImpl(scriptUri,
        SCRIPTMANAGER.code,
        new PlainLiteralImpl(
          new String(contentHandler.getData(scriptUri)))));

    GraphNode scriptLanguageList = getScriptLanguageList(resource);
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.