Package org.openrdf.model

Examples of org.openrdf.model.Resource


      RepositoryConnection con = repository.getConnection();
      try {
        Resource[] contexts = new Resource[0];

        if (context != null) {
          Resource contextURI;
          if (context.startsWith("_:")) {
            contextURI = con.getValueFactory().createBNode(context.substring(2));
          }
          else {
            contextURI = con.getValueFactory().createURI(context);
View Full Code Here


    if (!writingStarted) {
      throw new RDFHandlerException("Document writing has not yet been started");
    }

    try {
      Resource context = st.getContext();

      if (inActiveContext && !contextsEquals(context, currentContext)) {
        // Close currently active context
        xmlWriter.endTag(CONTEXT_TAG);
        inActiveContext = false;
View Full Code Here

    else {
      // topElement instanceof PropertyElement
      PropertyElement predicate = (PropertyElement)topElement;

      if (predicate.parseCollection()) {
        Resource lastListResource = predicate.getLastListResource();

        if (lastListResource == null) {
          // no last list resource, list must have been empty.
          NodeElement subject = (NodeElement)peekStack(1);
View Full Code Here

  @Override
  public void meet(StatementPattern node)
    throws StoreException
  {
    Resource subj = (Resource)node.getSubjectVar().getValue();
    URI pred = (URI)node.getPredicateVar().getValue();
    Value obj = node.getObjectVar().getValue();
    Resource[] ctx = getContexts(node.getContextVar());
    for (RepositoryConnection member : members) {
      if (member.hasMatch(subj, pred, obj, true, ctx)) {
View Full Code Here

    if (verifyData()) {
      // Check the element name
      checkNodeEltName(namespaceURI, localName, qName);
    }

    Resource nodeResource = getNodeResource(atts);
    NodeElement nodeElement = new NodeElement(nodeResource);

    if (!elementStack.isEmpty()) {
      // node can be object of a statement, or part of an rdf:List
      NodeElement subject = (NodeElement)peekStack(1);
      PropertyElement predicate = (PropertyElement)peekStack(0);

      if (predicate.parseCollection()) {
        Resource lastListRes = predicate.getLastListResource();
        BNode newListRes = createBNode();

        if (lastListRes == null) {
          // first element in the list
          reportStatement(subject.getResource(), predicate.getURI(), newListRes);
View Full Code Here

      if (definedAttsCount > 1) {
        reportError("Only one of the attributes rdf:ID, rdf:about or rdf:nodeID can be used here");
      }
    }

    Resource result = null;

    if (id != null) {
      result = buildURIFromID(id.getValue());
    }
    else if (about != null) {
View Full Code Here

  /** processes subject attributes. */
  private void processSubjectAtts(NodeElement nodeElt, Atts atts)
    throws RDFParseException, RDFHandlerException
  {
    Resource subject = nodeElt.getResource();

    Iterator<Att> iter = atts.iterator();

    while (iter.hasNext()) {
      Att att = iter.next();
View Full Code Here

        reportStatement(subject.getResource(), propURI, lit);
        handleReification(lit);
      }
      else {
        // Create resource for the statement's object.
        Resource resourceRes = getPropertyResource(atts);

        // All special rdf attributes have been checked/removed.
        if (verifyData()) {
          checkRDFAtts(atts);
        }
View Full Code Here

      if (definedAttsCount > 1) {
        reportError("Only one of the attributes rdf:resource or rdf:nodeID can be used here");
      }
    }

    Resource result = null;

    if (resource != null) {
      result = resolveURI(resource.getValue());
    }
    else if (nodeID != null) {
View Full Code Here

      if (nextValue == null) {
        return null;
      }

      int subjID = ByteArrayUtil.getInt(nextValue, TripleStore.SUBJ_IDX);
      Resource subj = (Resource)valueStore.getValue(subjID);

      int predID = ByteArrayUtil.getInt(nextValue, TripleStore.PRED_IDX);
      URI pred = (URI)valueStore.getValue(predID);

      int objID = ByteArrayUtil.getInt(nextValue, TripleStore.OBJ_IDX);
      Value obj = valueStore.getValue(objID);

      Resource context = null;
      int contextID = ByteArrayUtil.getInt(nextValue, TripleStore.CONTEXT_IDX);
      if (contextID != 0) {
        context = (Resource)valueStore.getValue(contextID);
      }
View Full Code Here

TOP

Related Classes of org.openrdf.model.Resource

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.