Package com.hp.hpl.jena.graph

Examples of com.hp.hpl.jena.graph.Node


        return calcReturn(s, string.asNode()) ;
    }

    public static NodeValue strLowerCase(NodeValue string)
    {
        Node n = checkAndGetStringLiteral("lcase", string) ;
        String lex = n.getLiteralLexicalForm() ;
        String lex2 = lex.toLowerCase() ;
        return calcReturn(lex2, string.asNode()) ;
    }
View Full Code Here


        if ( predicateWidth > TRIPLES_PROPERTY_COLUMN )
            predicateWidth = TRIPLES_PROPERTY_COLUMN ;
       
        // Loops:
        List<Triple> subjAcc = new ArrayList<Triple>() ;    // Accumulate all triples with the same subject. 
        Node subj = null ;                  // Subject being accumulated
       
        boolean first = true ;             // Print newlines between blocks.
       
        int indent = -1 ;
        for ( Triple t : triples )
View Full Code Here

        if ( passthrough ) return base.getNodeForNodeId(id) ;
        long x = id.getId() ;
        if ( x < allocOffset )
            return base.getNodeForNodeId(id) ;
        id = mapToJournal(id) ;
        Node node = nodeTableJournal.getNodeForNodeId(id) ;
        return node ;
    }
View Full Code Here

            if ( firstPair == null )
                firstPair = x ;
            lastPair = x ;
           
            NodeId nodeId = x.getLeft() ;
            Node node = x.getRight() ;
            debug("  append: %s -> %s", x, mapFromJournal(nodeId)) ;
            // This does the write.
            NodeId nodeId2 = base.getAllocateNodeId(node) ;
            if ( ! nodeId2.equals(mapFromJournal(nodeId)) )
                inconsistent(node, nodeId, nodeId2) ;
View Full Code Here

        return calcReturn(lex2, string.asNode()) ;
    }

    public static NodeValue strUpperCase(NodeValue string)
    {
        Node n = checkAndGetStringLiteral("ucase", string) ;
        String lex = n.getLiteralLexicalForm() ;
        String lex2 = lex.toUpperCase() ;
        return calcReturn(lex2, string.asNode()) ;
    }
View Full Code Here

        Iterator<Pair<NodeId, Node>> iter = nodeTableJournal.all() ;
        for ( ; iter.hasNext() ; )
        {
            Pair<NodeId, Node> x = iter.next() ;
            NodeId nodeId = x.getLeft() ;
            Node node = x.getRight() ;
            NodeId mapped = mapFromJournal(nodeId) ;
            //debug("append: %s -> %s", x, mapFromJournal(nodeId)) ;
            // This does the write.
            NodeId nodeId2 = base.getAllocateNodeId(node) ;
            System.err.println(x + "  mapped=" + mapped + " getAlloc="+nodeId2) ;
View Full Code Here

        return calcReturn(lex2, string.asNode()) ;
    }
   
    public static NodeValue strEncodeForURI(NodeValue v)
    {
        Node n = v.asNode() ;
        if ( ! n.isLiteral() )
            throw new ExprEvalException("Not a literal") ;
        if ( n.getLiteralDatatype() != null )
        {
            if ( ! n.getLiteralDatatype().equals(XSDDatatype.XSDstring) )
                throw new ExprEvalException("Not a string literal") ;
        }
   
        String str = n.getLiteralLexicalForm() ;
        String encStr = IRILib.encodeUriComponent(str) ;
        encStr = IRILib.encodeNonASCII(encStr) ;
   
        return NodeValue.makeString(encStr) ;
    }
View Full Code Here

       
        StringBuilder sb = new StringBuilder() ;
       
        for ( NodeValue nv : args )
        {
            Node n = checkAndGetStringLiteral("CONCAT", nv) ;
            String lang1 = n.getLiteralLanguage() ;
            if ( ! lang1.equals("") )
            {
                if ( lang != null && ! lang1.equals(lang) )
                    //throw new ExprEvalException("CONCAT: Mixed language tags: "+args) ;
                    mixedLang = true ;
                lang = lang1 ;
            }
            else if ( n.getLiteralDatatype() != null )
                xsdString = true ;
            else
                simpleLiteral = true ;
           
            sb.append(n.getLiteralLexicalForm()) ;
        }
       
        if ( mixedLang )
            return NodeValue.makeString(sb.toString()) ;
       
View Full Code Here

            throw new ExprEvalException("Not a datatype with a timezone: "+nv) ;
        if ( "".equals(dts.timezone) )
            return null ;
        if ("Z".equals(dts.timezone) )
        {
            Node n = Node.createLiteral("PT0S", null, Node.getType(XSDDatatype.XSD+"#dayTimeDuration")) ;
            return NodeValue.makeNode(n) ;
        }
        if ("+00:00".equals(dts.timezone) )
        {
            Node n = Node.createLiteral("PT0S", null, Node.getType(XSDDatatype.XSD+"#dayTimeDuration")) ;
            return NodeValue.makeNode(n) ;
        }
        if ("-00:00".equals(dts.timezone) )
        {
            Node n = Node.createLiteral("-PT0S", null, Node.getType(XSDDatatype.XSD+"#dayTimeDuration")) ;
            return NodeValue.makeNode(n) ;
        }
       
        String s = dts.timezone ;
        int idx = 0;
View Full Code Here

    {
        Tokenizer tokenizer = TokenizerFactory.makeTokenizerString(string) ;
        if ( ! tokenizer.hasNext() )
            return null ;
        Token t = tokenizer.next();
        Node n = profile.create(null, t) ;
        if ( tokenizer.hasNext() )
            Log.warn(RiotLib.class, "String has more than one token in it: "+string) ;
        return n ;
    }
View Full Code Here

TOP

Related Classes of com.hp.hpl.jena.graph.Node

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.