Package org.apache.clerezza.rdf.core

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


    }
    lock = contentGraph.getLock().writeLock();
    lock.lock();
    try {
      Collection<Triple> tripleArray = new ArrayList<Triple>();
      NonLiteral cfc = new BNode();
      tripleArray.add(new TripleImpl(cfc, RDF.type,
          CUSTOMPROPERTY.CustomFieldCollection));
      tripleArray.add(new TripleImpl(cfc, CUSTOMPROPERTY.dependency,
          dependency));
      tripleArray.add(new TripleImpl(cfc, CUSTOMPROPERTY.dependencyvalue,
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

  }

  @GET
  public GraphNode resetPage(@Context UriInfo uriInfo) {
    TrailingSlash.enforcePresent(uriInfo);
    GraphNode result = new GraphNode(new BNode(), new SimpleMGraph());
    result.addProperty(RDF.type, USERMANAGER.PasswordResetPage);
    return result;
  }
View Full Code Here

          }
          MGraph temporary = new SimpleMGraph();
          temporary.add(new TripleImpl(agent, PERMISSION.password,
              new PlainLiteralImpl(newPassword)));
          MGraph result = new UnionMGraph(temporary, systemGraph);
          GraphNode mailGraph = new GraphNode(new BNode(), result);
          mailGraph.addProperty(RDF.type, USERMANAGER.PasswordResetMail);
          mailGraph.addProperty(USERMANAGER.recipient, agent);
          List<MediaType> acceptableMediaTypes =
          Collections.singletonList(MediaType.TEXT_PLAIN_TYPE);
          mailMan.sendEmailToUser(passwordUser, userName, "New Password",
View Full Code Here

  private NonLiteral createList(Iterator<String> iterator, LockableMGraph permissionMGraph) {
    if (!iterator.hasNext()) {
      return rdfNil;
    }
    final BNode result = new BNode();
    permissionMGraph.add(new TripleImpl(result, first,
        LiteralFactory.getInstance().createTypedLiteral(iterator.next())));
    permissionMGraph.add(new TripleImpl(result, rest,
        createList(iterator, permissionMGraph)));
    return result;
View Full Code Here

      }
      if (nodes1.size() != 1) {
        matchingGroups.put(nodes1, nodes2);
        continue;
      }
      final BNode bNode1 = nodes1.iterator().next();
      final BNode bNode2 = nodes2.iterator().next();
      matchings.put(bNode1,bNode2);
      //in the graphs replace node occurences with grounded node,
      NonLiteral mappedNode = new MappedNode(bNode1, bNode2);
      replaceNode(g1,bNode1, mappedNode);
      replaceNode(g2, bNode2, mappedNode);
View Full Code Here

  }

  @Test
  public void test6() {
    TripleCollection tc1 = new SimpleMGraph();
    final BNode b11 = new BNode();
    tc1.add(new TripleImpl(new BNode(), u1,b11));
    tc1.add(new TripleImpl(new BNode(), u1,b11));
    TripleCollection tc2 = new SimpleMGraph();
    tc2.add(new TripleImpl(new BNode(), u1, new BNode()));
    final Map<BNode, BNode> mapping = GraphMatcher.getValidMapping(tc1, tc2);
    Assert.assertNull(mapping);
  }
View Full Code Here

    final Map<BNode, BNode> mapping = GraphMatcher.getValidMapping(tc1, tc2);
    Assert.assertNull(mapping);
  }

  private MGraph generateCircle(int size) {
    return generateCircle(size, new BNode());
  }
View Full Code Here

      throw new IllegalArgumentException();
    }
    MGraph result = new SimpleMGraph();
    NonLiteral lastNode = firstNode;
    for (int i = 0; i < (size-1); i++) {
      final BNode newNode = new BNode();
      result.add(new TripleImpl(lastNode, u1, newNode));
      lastNode = newNode;
    }
    result.add(new TripleImpl(lastNode, u1, firstNode));
    return result;
View Full Code Here

    Assert.assertEquals(3, mapping.size());
  }

  @Test
  public void test10() {
    NonLiteral crossing1 = new BNode();
    TripleCollection tc1 = generateCircle(2,crossing1);
    tc1.addAll(generateCircle(3,crossing1));
    NonLiteral crossing2 = new BNode();
    TripleCollection tc2 = generateCircle(2,crossing2);
    tc2.addAll(generateCircle(3,crossing2));
    Assert.assertEquals(5, tc1.size());
    final Map<BNode, BNode> mapping = GraphMatcher.getValidMapping(tc1, tc2);
    Assert.assertNotNull(mapping);
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.