Examples of asLiteral()


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

    Iterator<RDFNode> it = nodes.iterator();
    Literal aLiteral = null;
    while (it.hasNext()) {
      RDFNode candidate = it.next();
      if (!candidate.isLiteral()) continue;
      Literal literal = candidate.asLiteral();
      if (lang == null
          || lang.equals(literal.getLanguage())) {
        return literal;
      }
      aLiteral = literal;
View Full Code Here

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

          }
          System.out.println("  " + resourceName);
          while(nodes.hasNext()) {
            RDFNode node = nodes.nextNode();
            if(node.isLiteral()) {
              System.out.println("   l " + node.asLiteral().getString());
            } else if(node.isResource()) {
              System.out.println("   r " + node.asResource().getURI());
            }
          }         
        }
View Full Code Here

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

          }
          System.out.println("  " + resourceName);
          while(nodes.hasNext()) {
            RDFNode node = nodes.nextNode();
            if(node.isLiteral()) {
              System.out.println("   l " + node.asLiteral().getString());
            } else if(node.isResource()) {
              System.out.println("   r " + node.asResource().getURI());
            }
          }         
        }
View Full Code Here

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

      RDFNode object = statement.getObject();
     
      // First iteration: set value to the local name (if available)
      String key = null, value = null ;
      if(object.isLiteral()) {
        Literal literal = object.asLiteral() ;
        String lang = literal.getLanguage() ;
        if
            lang.isEmpty()   ||  // not relevant to this literal... ignore!
           
            language == null ||  // don't care about language in this call
View Full Code Here

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

    Iterator<String> varnames = soln.varNames() ;
    while( varnames.hasNext()) {
      String variable = varnames.next() ;
      RDFNode node = soln.get(variable);
      if(node.isLiteral() ) {
        Literal literal = node.asLiteral() ;
        valueMap.put(variable, literal.getLexicalForm()) ;
      } else {
        valueMap.put(variable, node.toString()) ;
      }
    }
View Full Code Here

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

        if(!categories.containsKey(uri)) {
          categories.put(uri, new HashMap<String,String>()) ;
        }
       
        if(node!=null && node.isLiteral() ) {
          Literal nameLiteral = node.asLiteral() ;
          String  language = nameLiteral.getLanguage() ;
          String  name     = nameLiteral.getLexicalForm() ;
          if(language == null) language = "en" ;
          categories.get(uri).put(language, name) ;
          if ( _VERBOSE ){System.out.println("Category '"+uri+"' has name '"+name+"' in language '"+language+"'");
View Full Code Here

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

    if(s != null)
    {
      RDFNode node = s.getObject();
      if(node != null && node.isLiteral())
      {
        sourceType = node.asLiteral().getString();
        return SourceTypes.valueOf(sourceType);
      }
    }
    return SourceTypes.CSV;
   
View Full Code Here

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

        logger.debug("service uri: " + service_uri);
        logger.debug("service id: " + service_id);
        if (name != null && name.isLiteral()) service_name = name.asLiteral().getString();
        logger.debug("service name: " + service_name);
        if (address != null && address.isLiteral()) service_address = address.asLiteral().getString();
        logger.debug("service address: " + service_address);
       
        if (service_id.trim().length() > 0)
          serviceList.add(new WebService(service_id, service_name, service_address));
        else
View Full Code Here

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

    RDFNode node = null;

    // service name
    nodeIterator = model.listObjectsOfProperty(service_resource, has_name_property);
    if (nodeIterator.hasNext() && (node = nodeIterator.next()).isLiteral()) {
      service_name = node.asLiteral().getString();
      logger.debug("service name: " + service_name);
    } else
      logger.debug("service does not have a name.");
   
    // service address
View Full Code Here

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

      logger.debug("service does not have a name.");
   
    // service address
    nodeIterator = model.listObjectsOfProperty(service_resource, has_address_property);
    if (nodeIterator.hasNext() && (node = nodeIterator.next()).isLiteral()) {
      service_address = node.asLiteral().getString();
      logger.debug("service address: " + service_address);
    } else
      logger.debug("service does not have an address.");

    // service method
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.