Package com.hp.hpl.jena.rdf.model

Examples of com.hp.hpl.jena.rdf.model.RDFNode.asResource()


    nodeIterator = model.listObjectsOfProperty(atom_resource, argument1_property);
    if (nodeIterator.hasNext() && (node = nodeIterator.next()).isResource()) {
      argument1Id = node.asResource().getLocalName();
      logger.debug("The atom argument1 is: " + argument1Id);
     
      if (isInstanceOfTheClass(node.asResource(), attribute))
        argument1Type = ArgumentType.ATTRIBUTE;
      else if (isInstanceOfTheClass(node.asResource(), variable))
        argument1Type = ArgumentType.VARIABLE;
     
    } else {
View Full Code Here


      argument1Id = node.asResource().getLocalName();
      logger.debug("The atom argument1 is: " + argument1Id);
     
      if (isInstanceOfTheClass(node.asResource(), attribute))
        argument1Type = ArgumentType.ATTRIBUTE;
      else if (isInstanceOfTheClass(node.asResource(), variable))
        argument1Type = ArgumentType.VARIABLE;
     
    } else {
      logger.info("atom does not have an argument1.");
      return null;
View Full Code Here

    if (!nodeIterator.hasNext() || !(node = nodeIterator.next()).isResource()) {
      logger.info("The property predicate resource is not specified.");
      return null;
    }
   
    predicateUri = node.asResource().getURI();
    logger.debug("The atom predicate is: " + predicateUri);
    predicateNs = node.asResource().getNameSpace();
    predicatePrefix = model.getNsURIPrefix(predicateNs);
   
    // atom argument1
View Full Code Here

      return null;
    }
   
    predicateUri = node.asResource().getURI();
    logger.debug("The atom predicate is: " + predicateUri);
    predicateNs = node.asResource().getNameSpace();
    predicatePrefix = model.getNsURIPrefix(predicateNs);
   
    // atom argument1
    nodeIterator = model.listObjectsOfProperty(atom_resource, argument1_property);
    if (nodeIterator.hasNext() && (node = nodeIterator.next()).isResource()) {
View Full Code Here

                    }

                    tree.addText(node.asLiteral().toString());
                    tree.addEndElement();
                } else if (node.isResource()) {
                    Resource rsrc = node.asResource();

                    if (rsrc.toString().startsWith("http://marklogic.com/semantics/blank/")) {
                        tree.addStartElement(s_bnode);
                        tree.startContent();
                        tree.addText(rsrc.toString());
View Full Code Here

                    throw new SpatialIndexException("No 'spatial:directory' property on "+root+ " is a literal and not \"mem\"") ;
                 directory = new RAMDirectory() ;
            }
            else
            {
                Resource x = n.asResource() ;
                String path = IRILib.IRIToFilename(x.getURI()) ;
                File dir = new File(path) ;
                directory = FSDirectory.open(dir) ;
            }
       
View Full Code Here

                if ( !"mem".equals(n.asLiteral().getLexicalForm()) )
                    throw new TextIndexException("No 'text:directory' property on " + root
                                                 + " is a literal and not \"mem\"") ;
                directory = new RAMDirectory() ;
            } else {
                Resource x = n.asResource() ;
                String path = IRILib.IRIToFilename(x.getURI()) ;
                File dir = new File(path) ;
                directory = FSDirectory.open(dir) ;
            }
View Full Code Here

    int count = 0;
    while (resultSet.hasNext()) {
      QuerySolution querySolution = resultSet.next();
      RDFNode rdfNode = querySolution.get(sparqlKeyword);
     
      ps.setString(1, rdfNode.asResource().getURI().trim());
      ps.setInt(2, endpointId);
      ps.setString(3, method.get());
      ps.addBatch();
      if (++count % batchSize == 0) {
        System.out.println(count + " done");
View Full Code Here

            if (literalTypeNode != null)
            {
                if (literalTypeNode.isURIResource())
                {
                    return m.createTypedLiteral(modifiedValue,
                            literalTypeNode.asResource().getURI());
                } else {
                    log.warn("A LiteralGenerator has a property 'literalType' that "
                            + "either is a blank node or a Literal. Ignoring it.");
                }
            }
View Full Code Here

            {
                log.error("The modifier of a result is a Literal not an Resource! "
                        + "Ingoring this result.");
                return null;
            }
            Resource modifier = modifierNode.asResource();

            RDFNode matcherNode;
            try
            {
                matcherNode = getSingularProperty(modifier, DMRM.matcher);
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.