Package com.hp.hpl.jena.shared

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


    }

    @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


        }
       
    public void testCreateURIOtherMap()
        {
        String myNS = "eh:foo/bar#", suffix = "something";
        PrefixMapping mine = PrefixMapping.Factory.create().setNsPrefix( "mine", myNS );
        Node n = NodeCreateUtils.create( mine, "mine:" + suffix );
        assertEquals( myNS + suffix, n.getURI() );
        }
View Full Code Here

            }
        }
       
    public void testCreatePrefixed()
        {
        PrefixMapping pm = PrefixMapping.Factory.create();
        /* TODO Node n = */ NodeCreateUtils.create( pm, "xyz" );
        }
View Full Code Here

        /* TODO Node n = */ NodeCreateUtils.create( pm, "xyz" );
        }
       
    public void testToStringWithPrefixMapping()
        {
        PrefixMapping pm = PrefixMapping.Factory.create();
        String prefix = "spoo", ns = "abc:def/ghi#";
        pm.setNsPrefix( prefix, ns );
        String suffix = "bamboozle";
        assertEquals( prefix + ":" + suffix, NodeCreateUtils.create( ns + suffix ).toString( pm ) );   
        }
View Full Code Here

    }
   
    private static void print(BasicPattern bgp) {
        IndentedWriter out = IndentedWriter.stdout;
       
        PrefixMapping pmap = new PrefixMappingImpl() ;
        pmap.setNsPrefixes(SSE.defaultPrefixMapWrite) ;
//        pmap.setNsPrefix("ppi", "http://landregistry.data.gov.uk/def/ppi/") ;
//        pmap.setNsPrefix("common", "http://landregistry.data.gov.uk/def/common/") ;
       
        SerializationContext sCxt = SSE.sCxt(pmap) ;
       
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

        {
            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

            }
        }

    protected void checkStandardPrefixes( Report r, Model toTest )
        {
        PrefixMapping toUse = PrefixMapping.Extended;
        Iterator<String> keys = toUse.getNsPrefixMap().keySet().iterator();
        while (keys.hasNext())
            {
            String key = keys.next();
            String modelValue = toTest.getNsPrefixURI( key );
            String expected = toUse.getNsPrefixURI( key );
            if (modelValue != null && !modelValue.equals( expected))
                {
                r.createItem()
                    .addMainProperty( EYE.badNamespaceURI, modelValue )
                    .addProperty( EYE.expected, expected )
View Full Code Here

public class AssemblerUtils
{
    // Wrappers for reading things form a file - assumes one of the thing per file.
    public static PrefixMapping readPrefixMapping(String file)
    {
        PrefixMapping pm = (PrefixMapping)AssemblerUtils.build(file, JA.PrefixMapping) ;
        return pm ;
    }
View Full Code Here

        this.resolver = other.resolver ;
    }

    public Prologue copy()
    {
        PrefixMapping prefixMap = new PrefixMappingImpl() ;
        prefixMap.setNsPrefixes(this.prefixMap) ;
        return new Prologue(prefixMap, resolver.getBaseIRI()) ;
    }
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.