Package org.apache.clerezza.rdf.core

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


    }

    private Resource createRandomResource() {
        switch (rollDice(3)) {
            case 0:
                return new BNode();
            case 1:
                return createRandomUriRef();
            case 2:
                return new PlainLiteralImpl(RandomStringUtils.random(rollDice(100) + 1));
        }
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

        TripleCollection tc = provider.getTriples(graphUriRef);
        assertNotNull(tc);
    }

    private Triple createTestTriple() {
        NonLiteral subject = new BNode() {};
        UriRef predicate = new UriRef("http://test.com/");
        NonLiteral object = new UriRef("http://test.com/myObject");
        return new TripleImpl(subject, predicate, object);
    }
View Full Code Here

    }
    if (nextTo > userList.size()) {
      nextTo = userList.size();
    }

    NonLiteral userOverviewPage = new BNode();
    List<Resource> resultList = new RdfList(userOverviewPage, resultGraph);
    for (int i = from; i < to; i++) {
      resultList.add(userList.get(i).getNode());
    }
   
View Full Code Here

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

    MGraph resultGraph = new SimpleMGraph();
    NonLiteral addUserPage = new BNode();

    resultGraph.add(new TripleImpl(addUserPage, RDF.type,
        USERMANAGER.AddUserPage));
    resultGraph.add(new TripleImpl(addUserPage, RDF.type,
        PLATFORM.HeadedPage));
View Full Code Here

    if (!message.isEmpty()) {
      returnInputErrorMessages(message);
    }
    userManager.storeUser(userName, email, psw, userRoles, pathPrefix);
    LockableMGraph contentGraph = (LockableMGraph) cgProvider.getContentGraph();
    NonLiteral user = new BNode();
   
    Lock writeLock = contentGraph.getLock().writeLock();
    writeLock.lock();
    try {
      contentGraph.add(new TripleImpl(user, RDF.type, FOAF.Agent));
View Full Code Here

      @QueryParam(value = "user") String userName,
      @Context UriInfo uriInfo) throws ParseException {
    AccessController.checkPermission(new UserManagerAccessPermission());
    LockableMGraph contentGraph = (LockableMGraph) cgProvider.getContentGraph();
    MGraph resultGraph = new SimpleMGraph();
    NonLiteral node = new BNode();

    resultGraph.add(new TripleImpl(resource, USERMANAGER.custominformation,
        node));
    resultGraph.add(new TripleImpl(node, RDF.type,
        USERMANAGER.CustomUserInformationPage));
View Full Code Here

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

    MGraph resultGraph = new SimpleMGraph();
    NonLiteral userPermissionPage = new BNode();
    Iterator<PermissionDescripton> permDescs = permGatherer.getAllPermissionDescriptors();
    while(permDescs.hasNext()) {
      PermissionDescripton desc = permDescs.next();
      BNode providedPermission = new BNode();
      resultGraph.add(new TripleImpl(userPermissionPage,
          USERMANAGER.permission, providedPermission));

      resultGraph.add(new TripleImpl(providedPermission,
          PERMISSION.javaPermissionEntry, new PlainLiteralImpl(desc.getJavaPermissionString())));
View Full Code Here

    TrailingSlash.enforceNotPresent(uriInfo);

    NonLiteral user = userManager.getUserByName(userName);
    if (user != null) {
      MGraph resultGraph = new SimpleMGraph();
      NonLiteral updateUserPage = new BNode();
      resultGraph.add(new TripleImpl(updateUserPage, RDF.type,
          USERMANAGER.UpdateUserPage));
      resultGraph.add(new TripleImpl(updateUserPage, RDF.type,
          PLATFORM.HeadedPage));
     
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.