Package org.openrdf.model

Examples of org.openrdf.model.BNode


    return c;
  }

  public boolean isNotSignedBNode(Value o) {
    if (o instanceof BNode) {
      BNode node = (BNode)o;
      if (external.isInternalBNode(node) && in.containsKey(o)) {
        return false;
      }
      if (node.getID().endsWith(suffix)) {
        return false;
      }
      return true;
    }
    return false;
View Full Code Here


    return false;
  }

  public boolean isSignedBNode(Value o) {
    if (o instanceof BNode) {
      BNode node = (BNode)o;
      if (external.isInternalBNode(node) && in.containsKey(o)) {
        return true;
      }
      if (node.getID().endsWith(suffix)) {
        return true;
      }
      return false;
    }
    return false;
View Full Code Here

    return false;
  }

  public Value removeSignature(Value subj) {
    if (subj instanceof BNode) {
      BNode node = (BNode)subj;
      String nodeID = node.getID();
      if (nodeID.endsWith(suffix)) {
        nodeID = nodeID.substring(0, nodeID.length() - suffix.length());
        return new BNodeImpl(nodeID);
      }
      if (external.isInternalBNode(node)) {
        BNode b = in.get(node);
        return b == null ? node : b;
      }
    }
    return subj;
  }
View Full Code Here

    ValueFactory vf = getConnection().getValueFactory();

    List<String> columns = Arrays.asList(Protocol.BNODE);
    List<BindingSet> bnodes = new ArrayList<BindingSet>(amount);
    for (int i = 0; i < amount; i++) {
      BNode bnode = createBNode(vf, nodeID, i);
      bnodes.add(new ListBindingSet(columns, bnode));
    }

    return new TupleResultImpl(columns, bnodes);
  }
View Full Code Here

                .createLiteral("Test literal");
        Literal testSesameObjectLangLiteral1 = VF.createLiteral("Test literal",
                "en");
        Literal testSesameObjectTypedLiteral1 = VF.createLiteral(
                "Test literal", VF.createURI("urn:test:datatype:1"));
        BNode testSesameSubjectBNode1 = VF.createBNode("subjectBnode1");
        BNode testSesameObjectBNode1 = VF.createBNode("objectBnode1");
        testSesameTripleAllIRI = VF.createStatement(testSesameSubjectUri1,
                testSesamePredicateUri1, testSesameObjectUri1);
        testSesameTriplePlainLiteral = VF.createStatement(
                testSesameSubjectUri1, testSesamePredicateUri1,
                testSesameObjectPlainLiteral1);
View Full Code Here

   * @param factory OpenRDF value factory
   * @return the OpenRDF instance wrapped in the given RDF2Go blank node or a
   *         new OpenRDF blank node with the same internal ID.
   */
  public static BNode toOpenRDF(BlankNode node, ValueFactory factory) {
    BNode result = null;
   
    if(node != null) {
      Object underlyingBlankNode = ((AbstractBlankNodeImpl)node).getUnderlyingBlankNode();
     
      if(underlyingBlankNode instanceof BNode) {
View Full Code Here

        } catch (NumberFormatException nfe) {
            return;
        }

        final ValueFactory factory = new Any23ValueFactoryWrapper(ValueFactoryImpl.getInstance(), out);
        BNode point = factory.createBNode();
        out.writeTriple(extractionContext.getDocumentURI(), expand("dcterms:related"), point);
        out.writeTriple(point, expand("rdf:type"), expand("geo:Point"));
        out.writeTriple(point, expand("geo:lat"), factory.createLiteral(Float.toString(lat)));
        out.writeTriple(point, expand("geo:long"), factory.createLiteral(Float.toString(lon)));
    }
View Full Code Here

        return foundAny;
    }

    private boolean extractComponent(Node node, Resource cal, String component) throws ExtractionException {
        HTMLDocument compoNode = new HTMLDocument(node);
        BNode evt = valueFactory.createBNode();
        addURIProperty(evt, RDF.TYPE, vICAL.getClass(component));
        addTextProps(compoNode, evt);
        addUrl(compoNode, evt);
        addRRule(compoNode, evt);
        addOrganizer(compoNode, evt);
View Full Code Here

        addURIProperty(evt, vICAL.url, getHTMLDocument().resolveURI(url.value()));
    }

    private void addRRule(HTMLDocument compoNode, Resource evt) {
        for (Node rule : compoNode.findAllByClassName("rrule")) {
            BNode rrule = valueFactory.createBNode();
            addURIProperty(rrule, RDF.TYPE, vICAL.DomainOf_rrule);
            TextField freq = new HTMLDocument(rule).getSingularTextField("freq");
            conditionallyAddStringProperty(
                    freq.source(),
                    rrule, vICAL.freq, freq.value()
View Full Code Here

    }

    private void addOrganizer(HTMLDocument compoNode, Resource evt) {
        for (Node organizer : compoNode.findAllByClassName("organizer")) {
            //untyped
            BNode blank = valueFactory.createBNode();
            TextField mail = new HTMLDocument(organizer).getSingularUrlField("organizer");
            conditionallyAddStringProperty(
                    compoNode.getDocument(),
                    blank, vICAL.calAddress, mail.value()
            );
View Full Code Here

TOP

Related Classes of org.openrdf.model.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.