Package com.hp.hpl.jena.shared

Examples of com.hp.hpl.jena.shared.PrefixMapping


            return "<not found>" ;
        DatasetGraph dsg = desc.dataset ;
       
        if ( dsg instanceof DatasetGraphTDB )
        {
            PrefixMapping pmap = ((DatasetGraphTDB)dsg).getPrefixes().getPrefixMapping() ;
            Prologue prologue = new Prologue(pmap) ;
            IndentedLineBuffer buff = new IndentedLineBuffer() ;
            PrologueSerializer.output(buff, prologue) ;
            buff.append("\n") ;
            return buff.asString() ;
View Full Code Here


        {
            String exprStr = cl.getPositionalArg(i) ;
            exprStr = cl.indirect(exprStr) ;
           
            try {
                PrefixMapping pmap = PrefixMapping.Factory.create()  ;
                pmap.setNsPrefixes(ARQConstants.getGlobalPrefixMap()) ;
                pmap.setNsPrefix("", "http://example/") ;
                pmap.setNsPrefix("ex", "http://example/ns#") ;
//              Node n = asNode() ;
//              return makeNode(n) ;

                Expr expr = ExprUtils.parse(exprStr, pmap) ;
                if ( verbose )
View Full Code Here

    private Node aUriRemappableNode() {
        return NodeFactory.createURI(aUri + "abs") ;
    }

    private PrefixMapping getPrefixMapping() {
        PrefixMapping pmap = new PrefixMappingImpl() ;
        pmap.setNsPrefix("zz", aUri) ;
        return pmap ;
    }
View Full Code Here

    /** Return a PrefixMapping for a named graph */
    @Override
    public PrefixMapping getPrefixMapping(String graphName)
    {
        PrefixMapping pm = new GraphPrefixesProjection(graphName, this) ;
        // Force into cache.
        // See JENA-81
        pm.getNsPrefixMap() ;
        return pm ;
    }
View Full Code Here

            if ( graphName != null && graphName.isBlank() ) {
                loadLogger.warn("Prefixes for blank node graphs not stored") ;
                return ;
            }

            PrefixMapping pmap = (graphName == null)
                                                    ? dsg.getPrefixes().getPrefixMapping()
                                                    : dsg.getPrefixes().getPrefixMapping(graphName.getURI()) ;
            pmap.setNsPrefix(prefix, iri) ;
        }
View Full Code Here

            return ;
        }
       
        if ( isPrefix )
        {
            PrefixMapping newMappings = BuilderPrefixMapping.build(item) ;
            prologue = prologue.sub(newMappings) ;
            // Remember first prefix mapping seen.
            if( topMap == null )
                topMap = newMappings ;
            return ;
View Full Code Here

public class OpPrefixesUsed
{
    static public PrefixMapping used(Op op, PrefixMapping pmap)
    {
        PrefixMapping pmap2 = new PrefixMappingImpl() ;
        PrefixFinder finder = new PrefixFinder(pmap2, pmap.getNsPrefixMap()) ;
        OpWalker.walk(op, finder) ;
        return pmap2 ;
    }
View Full Code Here

    {
        try {
            if ( dataset != null )
            {
                // Load the models prefixes first
                PrefixMapping m = dataset.getDefaultModel() ;
                model.setNsPrefixes(m) ;
            }
            // Then add the queries (just the declared mappings)
            // so the query declarations override the data sources.
            model.setNsPrefixes(query.getPrefixMapping()) ;
View Full Code Here

    }
   
    @Override
    protected PrefixMapping createPrefixMapping()
    {
        PrefixMapping pmap = new PrefixMappingImpl() ;
        for ( Node gn : graphs )
        {
            if ( ! gn.isURI() ) continue ;
            Graph g = dataset.getGraph(gn) ;
            PrefixMapping pmapNamedGraph = g.getPrefixMapping() ;
            pmap.setNsPrefixes(pmapNamedGraph) ;
        }
        return pmap ;
    }
View Full Code Here

                    out.print("(base ") ;
                    out.println(FmtUtils.stringForURI(sCxt.getBaseIRI())) ;
                    doneBase = true ;
                    out.incIndent() ;
                }
                PrefixMapping pmap = sCxt.getPrefixMapping() ;
                if ( pmap != null )
                {
                    Map<String,String> pm = pmap.getNsPrefixMap() ;
                    donePrefix = ( pm.size() != 0 ) ;
                    if ( pm.size() != 0 )
                    {
                        out.println("(prefix") ;
                        out.incIndent() ;
View Full Code Here

TOP

Related Classes of com.hp.hpl.jena.shared.PrefixMapping

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.