Package org.apache.clerezza.rdf.core

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


  }

  @Test
  public void equality() {
    MGraph g = new SimpleMGraph();
    BNode bNode1 = new BNode() {};
    BNode bNode2 = new BNode() {};
    UriRef property1 = new UriRef("http://example.org/property1");
    GraphNode n = new GraphNode(bNode1, g);
    n.addProperty(property1, bNode2);
    Assert.assertTrue(n.equals(new GraphNode(bNode1, g)));
    Assert.assertFalse(n.equals(new GraphNode(bNode2, g)));
View Full Code Here


    @GET
    @Path("success")
    public GraphNode logoutSuccessPage(@Context UriInfo uriInfo) {
  TrailingSlash.enforcePresent(uriInfo);
  GraphNode result = new GraphNode(new BNode(), new SimpleMGraph());
  PlainLiteral message = new PlainLiteralImpl(
    "You successfully logged out.");
  result.addProperty(LOGIN.message, message);
  result.addProperty(RDF.type, LOGIN.LoginPage);
View Full Code Here

  @GET
  public GraphNode loginPage(@Context UriInfo uriInfo,
      @QueryParam("referer") String refererUri,
      @QueryParam("cause") Integer cause) {
    TrailingSlash.enforceNotPresent(uriInfo);
    GraphNode result = new GraphNode(new BNode(), new SimpleMGraph());
    result.addProperty(RDF.type, LOGIN.LoginPage);
    result.addProperty(LOGIN.refererUri, new UriRef(refererUri));
    String user = getUserName();
    if (!user.equals("anonymous") && cause != null &&
        cause.equals(CookieAuthentication.NOT_ENOUGH_PERMISSIONS)) {
View Full Code Here

      @DefaultValue("false") @FormParam("stayloggedin") final Boolean stayLoggedIn,
      @Context final UriInfo uriInfo) {
    return AccessController.doPrivileged(new PrivilegedAction<Object>() {
      @Override
      public Object run() {
        GraphNode result = new GraphNode(new BNode(), new SimpleMGraph());
        result.addProperty(RDF.type, LOGIN.LoginPage);
        PlainLiteral failedMessage = new PlainLiteralImpl(
            "Username name or password are wrong");
        try {
          if (authenticationService.authenticateUser(userName,password)) {
View Full Code Here

  @Test
  public void simpleBNode()  {
    MGraph mGraph = new SimpleMGraph();
    UriRef mbox1 = new UriRef("mailto:foo@example.org");
    final BNode bNode1 = new BNode();
    mGraph.add(new TripleImpl(bNode1, FOAF.mbox, mbox1));
    mGraph.add(new TripleImpl(bNode1, RDFS.comment,
        new PlainLiteralImpl("a comment")));
    final BNode bNode2 = new BNode();
    mGraph.add(new TripleImpl(bNode2, FOAF.mbox, mbox1));
    mGraph.add(new TripleImpl(bNode2, RDFS.comment,
        new PlainLiteralImpl("another comment")));
    Smusher.smush(mGraph, ontology);
    Assert.assertEquals(3, mGraph.size());
View Full Code Here

  @Test
  public void overlappingEquivalenceClasses()  {
    MGraph mGraph = new SimpleMGraph();
    UriRef mbox1 = new UriRef("mailto:foo@example.org");
    final BNode bNode1 = new BNode();
    mGraph.add(new TripleImpl(bNode1, FOAF.mbox, mbox1));
    mGraph.add(new TripleImpl(bNode1, RDFS.comment,
        new PlainLiteralImpl("a comment")));
    final BNode bNode2 = new BNode();
    UriRef mbox2 = new UriRef("mailto:bar@example.org");
    mGraph.add(new TripleImpl(bNode2, FOAF.mbox, mbox1));
    mGraph.add(new TripleImpl(bNode2, FOAF.mbox, mbox2));
    mGraph.add(new TripleImpl(bNode2, RDFS.comment,
        new PlainLiteralImpl("another comment")));
    final BNode bNode3 = new BNode();
    mGraph.add(new TripleImpl(bNode3, FOAF.mbox, mbox2));
    mGraph.add(new TripleImpl(bNode3, RDFS.comment,
        new PlainLiteralImpl("yet another comment")));
    Smusher.smush(mGraph, ontology);
    Assert.assertEquals(5, mGraph.size());
View Full Code Here

    UriRef mbox1 = new UriRef("mailto:foo@example.org");
    final UriRef resource = new UriRef("http://example.org/");
    mGraph.add(new TripleImpl(resource, FOAF.mbox, mbox1));
    mGraph.add(new TripleImpl(resource, RDFS.comment,
        new PlainLiteralImpl("a comment")));
    final BNode bNode2 = new BNode();
    mGraph.add(new TripleImpl(bNode2, FOAF.mbox, mbox1));
    mGraph.add(new TripleImpl(bNode2, RDFS.comment,
        new PlainLiteralImpl("another comment")));
    Smusher.smush(mGraph, ontology);
    Assert.assertEquals(3, mGraph.size());
View Full Code Here

  @Test
  public void readAccess() {
    MGraph graph = new SimpleMGraph();
    MGraph graph2 = new SimpleMGraph();
    BNode bnode = new BNode() {
    };
    graph.add(new TripleImpl(uriRef1, uriRef2, uriRef1));
    graph2.add(new TripleImpl(bnode, uriRef1, uriRef3));
    MGraph unionGraph = new UnionMGraph(graph, graph2);
    Iterator<Triple> unionTriples = unionGraph.iterator();
View Full Code Here

 
  @Test
  public void writeAccess() {
    MGraph graph = new SimpleMGraph();
    MGraph graph2 = new SimpleMGraph();
    BNode bnode = new BNode() {
    };
    graph2.add(new TripleImpl(bnode, uriRef1, uriRef3));
    MGraph unionGraph = new UnionMGraph(graph, graph2);
    Assert.assertEquals(1, unionGraph.size());
    unionGraph.add(new TripleImpl(uriRef4, uriRef1, uriRef3));
View Full Code Here

        new UriRef("http://foo/bar"),
        LiteralFactory.getInstance().createTypedLiteral("foo")));
    mGraph.add(new TripleImpl(new UriRef("http://foo/bar"),
        new UriRef("http://foo/bar"),
        LiteralFactory.getInstance().createTypedLiteral(54675)));
    mGraph.add(new TripleImpl(new BNode(),
        new UriRef("http://foo/bar"),
        new UriRef("http://foo/bar")));
  }
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.