Package org.apache.clerezza.rdf.core

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


  public GraphNode listRoles(@Context UriInfo uriInfo) {
    AccessController.checkPermission(new UserManagerAccessPermission());
    TrailingSlash.enforceNotPresent(uriInfo);

    MGraph resultGraph = new SimpleMGraph();
    NonLiteral roleOverviewPage = new BNode();
    resultGraph.add(new TripleImpl(roleOverviewPage, RDF.type,
        USERMANAGER.RoleOverviewPage));
    resultGraph.add(new TripleImpl(roleOverviewPage, RDF.type,
        PLATFORM.HeadedPage));
   
View Full Code Here


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

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

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

    Graph jenaGraph = new JenaGraph(mGraph);
    Model model = ModelFactory.createModelForGraph(jenaGraph);
    model.add(DC.title, RDFS.label, "title");
    MGraph rewrappedMGraph = new JenaGraphAdaptor(jenaGraph);
    Assert.assertEquals(1, rewrappedMGraph.size());
    rewrappedMGraph.add(new TripleImpl(new BNode(), SKOS.prefLabel,
        LiteralFactory.getInstance().createTypedLiteral("foo")));
    Assert.assertEquals(2, rewrappedMGraph.size());
    Assert.assertEquals(2, mGraph.size());
    rewrappedMGraph.clear();
    Assert.assertEquals(0, rewrappedMGraph.size());
View Full Code Here

  @Path("get-execution-uri")
  @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,
View Full Code Here

    Iterator<Triple> tripleIter = graph.filter(uriRef1, uriRef2, uriRef1);
    Assert.assertTrue(tripleIter.hasNext());
    Triple tripleGot = tripleIter.next();
    Assert.assertEquals(triple1, tripleGot);
    Assert.assertFalse(tripleIter.hasNext());
    BNode bnode = new BNode() {};
    graph.add(new TripleImpl(bnode, uriRef1, uriRef3));
    graph.add(new TripleImpl(bnode, uriRef1, uriRef4));
    tripleIter = graph.filter(null, uriRef1, null);
    Set<NonLiteral> subjectInMatchingTriples = new HashSet<NonLiteral>();
    Set<Resource> objectsInMatchingTriples = new HashSet<Resource>();
View Full Code Here

  }

  @Test
  public void testGetSameBNode() throws Exception {
    MGraph graph = getEmptyMGraph();
    BNode bNode = new BNode();
    final UriRef HAS_NAME = new UriRef("http://example.org/ontology/hasName");
    final PlainLiteralImpl name = new PlainLiteralImpl("http://example.org/people/alice");
    final PlainLiteralImpl name2 = new PlainLiteralImpl("http://example.org/people/bob");
    final Triple tripleAlice = new TripleImpl(bNode, HAS_NAME, name);
    final Triple tripleBob = new TripleImpl(bNode, HAS_NAME, name2);
View Full Code Here

    try {
      if(contentGraph.filter(null, CUSTOMPROPERTY.property, property).hasNext()) {
        return null;
      }
      Collection<Triple> tripleArray = new ArrayList<Triple>();
      NonLiteral customField = new BNode();
      contentGraph.add(new TripleImpl(customField,
          CUSTOMPROPERTY.property, property));
      tripleArray.add(new TripleImpl(propertyCollection,
          CUSTOMPROPERTY.customfield, customField));
      tripleArray.add(new TripleImpl(customField, RDF.type,
View Full Code Here

  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

TOP

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

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.