Search in sources :

Example 31 with PrefixMap

use of org.apache.jena.riot.system.PrefixMap in project jena by apache.

the class TestPrefixLib method abbreviate_2.

@Test
public void abbreviate_2() {
    PrefixMap prefixes = create();
    prefixes.add(pref1, "http://example.net/ns#");
    String x = PrefixLib.abbreviate(prefixes, "http://other/ns#xyz");
    assertNull(x);
}
Also used : PrefixMap(org.apache.jena.riot.system.PrefixMap) Test(org.junit.Test)

Example 32 with PrefixMap

use of org.apache.jena.riot.system.PrefixMap in project jena by apache.

the class TestPrefixLib method abbrev_1.

@Test
public void abbrev_1() {
    PrefixMap prefixes = create();
    prefixes.add(pref1, "http://example.net/ns#");
    Pair<String, String> x = PrefixLib.abbrev(prefixes, "http://example.net/ns#xyz");
    assertEquals("pref1", x.getLeft());
    assertEquals("xyz", x.getRight());
}
Also used : PrefixMap(org.apache.jena.riot.system.PrefixMap) Test(org.junit.Test)

Example 33 with PrefixMap

use of org.apache.jena.riot.system.PrefixMap in project jena by apache.

the class TestPrefixMappingOverDatasetPrefixes2 method view.

@Override
protected PrefixMapping view() {
    StoragePrefixMap view = StoragePrefixesView.internal_viewGraph(dsgprefixes, gn);
    PrefixMap pmap = PrefixesDboeFactory.newPrefixMap(view);
    return Prefixes.adapt(pmap);
}
Also used : PrefixMap(org.apache.jena.riot.system.PrefixMap)

Aggregations

PrefixMap (org.apache.jena.riot.system.PrefixMap)33 Test (org.junit.Test)16 DatasetGraph (org.apache.jena.sparql.core.DatasetGraph)10 Map (java.util.Map)3 Node (org.apache.jena.graph.Node)2 QueryCancelledException (org.apache.jena.query.QueryCancelledException)2 QueryExecException (org.apache.jena.query.QueryExecException)2 NodeFormatter (org.apache.jena.riot.out.NodeFormatter)2 NodeFormatterTTL (org.apache.jena.riot.out.NodeFormatterTTL)2 JsonLdApi (com.github.jsonldjava.core.JsonLdApi)1 JsonLdOptions (com.github.jsonldjava.core.JsonLdOptions)1 RDFDataset (com.github.jsonldjava.core.RDFDataset)1 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 Iterator (java.util.Iterator)1 LinkedHashMap (java.util.LinkedHashMap)1 Iter (org.apache.jena.atlas.iterator.Iter)1 JsonObject (org.apache.jena.atlas.json.JsonObject)1 JsonString (org.apache.jena.atlas.json.JsonString)1 StoragePrefixes (org.apache.jena.dboe.storage.StoragePrefixes)1