Package com.hp.hpl.jena.shared.impl

Examples of com.hp.hpl.jena.shared.impl.PrefixMappingImpl


    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


    }

    @Test
    public void test_param_string_constructor_8() {
        // Test constructors with predefined prefixes
        PrefixMappingImpl prefixes = new PrefixMappingImpl();
        prefixes.setNsPrefix("ex", "http://example.org");
        ParameterizedSparqlString query = new ParameterizedSparqlString("", prefixes);

        Assert.assertEquals(prefixes.getNsPrefixURI("ex"), query.getNsPrefixURI("ex"));
    }
View Full Code Here

    @Test
    public void test_param_string_constructor_9() {
        // Test constructors with predefined prefixes - variant of constructor
        // that does not require command text
        PrefixMappingImpl prefixes = new PrefixMappingImpl();
        prefixes.setNsPrefix("ex", "http://example.org");
        ParameterizedSparqlString query = new ParameterizedSparqlString(prefixes);

        Assert.assertEquals(prefixes.getNsPrefixURI("ex"), query.getNsPrefixURI("ex"));
    }
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

        pmapLocal = localMapping ;
    }
   
    public PrefixMapping2(PrefixMapping globalMapping)
    {
        this(globalMapping, new PrefixMappingImpl()) ;
    }
View Full Code Here

    public ParameterizedSparqlString(String command, QuerySolutionMap map, String base, PrefixMapping prefixes) {
        if (command != null)
            this.cmd.append(command);
        this.setParams(map);
        this.baseUri = (base != null && !base.equals("") ? base : null);
        this.prefixes = new PrefixMappingImpl();
        if (prefixes != null)
            this.prefixes.setNsPrefixes(prefixes);
    }
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

    assertEquals("_:foo",
        PrettyPrinter.toString(Node.createAnon(new AnonId("foo"))));
    assertEquals("<http://example.org/>",
        PrettyPrinter.toString(Node.createURI("http://example.org/")));
    assertEquals("<" + RDF.type.getURI() + ">",
        PrettyPrinter.toString(RDF.type.asNode(), new PrefixMappingImpl()));
    assertEquals("rdf:type",
        PrettyPrinter.toString(RDF.type.asNode(), PrefixMapping.Standard));
    assertEquals("?x",
        PrettyPrinter.toString(Node.createVariable("x")));
    assertEquals("?ANY",
View Full Code Here

  public void testTriplePrettyPrintingWithNodeANY() {
    assertEquals("?ANY ?ANY ?ANY .", PrettyPrinter.toString(Triple.ANY));
  }
 
  public void testTriplePrettyPrintingWithPrefixMapping() {
    PrefixMappingImpl prefixes = new PrefixMappingImpl();
    prefixes.setNsPrefixes(PrefixMapping.Standard);
    prefixes.setNsPrefix("ex", "http://example.org/");
    assertEquals("ex:a rdfs:label \"Example\" .",
        PrettyPrinter.toString(new Triple(
            Node.createURI("http://example.org/a"),
            RDFS.label.asNode(),
            Node.createLiteral("Example", null, null)), prefixes));
View Full Code Here

public class CodecSimple implements EncoderDecoder
{
    private PrefixMapping prefixMapping ;
   
    public CodecSimple() { prefixMapping = new PrefixMappingImpl() ; }
View Full Code Here

TOP

Related Classes of com.hp.hpl.jena.shared.impl.PrefixMappingImpl

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.