@Override public PrefixMapping withDefaultMappings(PrefixMapping map) { return this.prefixes.withDefaultMappings(map); }
@Override public Model withDefaultMappings( PrefixMapping other ) { getPrefixMapping().withDefaultMappings( other ); return this; }
@Override public Model withDefaultMappings( PrefixMapping other ) { getPrefixMapping().withDefaultMappings( other ); return this; }
public static void addDataInto(DatasetGraph src, DatasetGraph dest) { Iterator<Quad> iter = src.find(Node.ANY, Node.ANY, Node.ANY, Node.ANY) ; for (; iter.hasNext();) { Quad q = iter.next() ; dest.add(q) ; } PrefixMapping pmapSrc = src.getDefaultGraph().getPrefixMapping() ; PrefixMapping pmapDest = dest.getDefaultGraph().getPrefixMapping() ; pmapDest.withDefaultMappings(pmapSrc) ; }
public static void addDataInto(DatasetGraph src, DatasetGraph dest) { Iterator<Quad> iter = src.find(Node.ANY, Node.ANY, Node.ANY, Node.ANY) ; for (; iter.hasNext();) { Quad q = iter.next() ; dest.add(q) ; } PrefixMapping pmapSrc = src.getDefaultGraph().getPrefixMapping() ; PrefixMapping pmapDest = dest.getDefaultGraph().getPrefixMapping() ; pmapDest.withDefaultMappings(pmapSrc) ; }
@Override public SecuredPrefixMapping withDefaultMappings(final PrefixMapping map) throws UpdateDeniedException, AuthenticationRequiredException { // mapping only updates if there are map entries to add. Since this gets // called // when we are doing deep triple checks while writing we need to attempt // the // update only if there are new updates to add. PrefixMapping m = holder.getBaseItem(); PrefixMappingImpl pm = new PrefixMappingImpl(); for (Entry<String, String> e : map.getNsPrefixMap().entrySet()) { if (m.getNsPrefixURI(e.getKey()) == null && m.getNsURIPrefix(e.getValue()) == null) { pm.setNsPrefix(e.getKey(), e.getValue()); } } if (!pm.getNsPrefixMap().isEmpty()) { checkUpdate(); holder.getBaseItem().withDefaultMappings(pm); } return holder.getSecuredItem(); } }
public static Dataset getConversationDataset(URI connectionURI, LinkedDataSource linkedDataSource) { assert linkedDataSource != null : "linkedDataSource must not be null"; int depth = 5; // depth 3 from connection gives us the messages in the conversation int maxRequests = 1000; List<Path> propertyPaths = new ArrayList<>(); PrefixMapping pmap = new PrefixMappingImpl(); pmap.withDefaultMappings(PrefixMapping.Standard); pmap.setNsPrefix("won", WON.getURI()); pmap.setNsPrefix("msg", WONMSG.getURI()); propertyPaths.add(PathParser.parse("won:hasEventContainer", pmap)); propertyPaths.add(PathParser.parse("won:hasEventContainer/rdfs:member", pmap)); propertyPaths.add(PathParser.parse("won:hasRemoteConnection", pmap)); propertyPaths.add(PathParser.parse("won:hasRemoteConnection/won:hasEventContainer", pmap)); propertyPaths.add(PathParser.parse("won:hasRemoteConnection/won:hasEventContainer/rdfs:member", pmap)); URI requesterWebId = WonLinkedDataUtils.getNeedURIforConnectionURI(connectionURI, linkedDataSource); return linkedDataSource.getDataForResourceWithPropertyPath(connectionURI, requesterWebId, propertyPaths, maxRequests, depth); }
public static Dataset getConversationAndNeedsDataset(URI connectionURI, LinkedDataSource linkedDataSource) { assert linkedDataSource != null : "linkedDataSource must not be null"; int depth = 5; int maxRequests = 1000; List<Path> propertyPaths = new ArrayList<>(); PrefixMapping pmap = new PrefixMappingImpl(); pmap.withDefaultMappings(PrefixMapping.Standard); pmap.setNsPrefix("won", WON.getURI()); pmap.setNsPrefix("msg", WONMSG.getURI()); propertyPaths.add(PathParser.parse("won:hasEventContainer", pmap)); propertyPaths.add(PathParser.parse("won:hasEventContainer/rdfs:member", pmap)); propertyPaths.add(PathParser.parse("won:hasEventContainer/rdfs:member/msg:hasCorrespondingRemoteMessage", pmap)); propertyPaths.add(PathParser.parse("won:hasEventContainer/rdfs:member/msg:hasPreviousMessage", pmap)); propertyPaths.add(PathParser.parse("won:belongsToNeed", pmap)); propertyPaths.add(PathParser.parse("won:belongsToNeed/won:hasEventContainer", pmap)); propertyPaths.add(PathParser.parse("won:belongsToNeed/won:hasEventContainer/rdfs:member", pmap)); propertyPaths.add(PathParser.parse("won:belongsToNeed/won:hasEventContainer/rdfs:member/msg:hasPreviousMessage", pmap)); propertyPaths.add(PathParser.parse("won:hasRemoteNeed", pmap)); propertyPaths.add(PathParser.parse("won:hasRemoteNeed/won:hasEventContainer", pmap)); propertyPaths.add(PathParser.parse("won:hasRemoteNeed/won:hasEventContainer/rdfs:member", pmap)); propertyPaths.add(PathParser.parse("won:hasRemoteNeed/won:hasEventContainer/rdfs:member/msg:hasPreviousMessage", pmap)); propertyPaths.add(PathParser.parse("won:hasRemoteConnection", pmap)); propertyPaths.add(PathParser.parse("won:hasRemoteConnection/won:hasEventContainer", pmap)); propertyPaths.add(PathParser.parse("won:hasRemoteConnection/won:hasEventContainer/rdfs:member", pmap)); propertyPaths.add(PathParser.parse("won:hasRemoteConnection/won:hasEventContainer/rdfs:member/msg:hasCorrespondingRemoteMessage", pmap)); propertyPaths.add(PathParser.parse("won:hasRemoteConnection/won:hasEventContainer/rdfs:member/msg:hasPreviousMessage", pmap)); URI requesterWebId = WonLinkedDataUtils.getNeedURIforConnectionURI(connectionURI, linkedDataSource); return linkedDataSource.getDataForResourceWithPropertyPath(connectionURI, requesterWebId, propertyPaths, maxRequests, depth); }
prefixMapping = PrefixMapping.Factory.create().withDefaultMappings(PrefixMapping.Standard); prefixMapping.setNsPrefix("dbo", "http://dbpedia.org/ontology/"); prefixMapping.setNsPrefix("wiki", "http://wikidata.dbpedia.org/resource/");
prefixMapping = PrefixMapping.Factory.create().withDefaultMappings(PrefixMapping.Standard); prefixMapping.setNsPrefix("ub", "http://swat.cse.lehigh.edu/onto/univ-bench.owl#");
pmap.withDefaultMappings(PrefixMapping.Standard); pmap.setNsPrefix("won", WON.getURI()); pmap.setNsPrefix("msg", WONMSG.getURI());
prefixMapping = PrefixMapping.Factory.create().withDefaultMappings(PrefixMapping.Standard); prefixMapping.setNsPrefix("dbo", "http://dbpedia.org/ontology/"); prefixMapping.setNsPrefix("wiki", "http://wikidata.dbpedia.org/resource/");
prefixMapping = PrefixMapping.Factory.create().withDefaultMappings(PrefixMapping.Standard); prefixMapping.setNsPrefix("dbo", "http://dbpedia.org/ontology/"); prefixMapping.setNsPrefix("wiki", "http://wikidata.dbpedia.org/resource/");
prefixMapping = PrefixMapping.Factory.create().withDefaultMappings(PrefixMapping.Standard); prefixMapping.setNsPrefix("drugbank", "http://www4.wiwiss.fu-berlin.de/drugbank/resource/drugbank/"); prefixMapping.setNsPrefix("drugs", "http://www4.wiwiss.fu-berlin.de/drugbank/resource/drugs/");
public void testAddDefaultMap() { PrefixMapping pm = getMapping(); PrefixMapping root = PrefixMapping.Factory.create(); pm.setNsPrefix( "a", "aPrefix:" ); pm.setNsPrefix( "b", "bPrefix:" ); root.setNsPrefix( "a", "pootle:" ); root.setNsPrefix( "z", "bPrefix:" ); root.setNsPrefix( "c", "cootle:" ); assertSame( pm, pm.withDefaultMappings( root ) ); assertEquals( "aPrefix:", pm.getNsPrefixURI( "a" ) ); assertEquals( null, pm.getNsPrefixURI( "z" ) ); assertEquals( "bPrefix:", pm.getNsPrefixURI( "b" ) ); assertEquals( "cootle:", pm.getNsPrefixURI( "c" ) ); }
public void testAddDefaultMap() { PrefixMapping pm = getMapping(); PrefixMapping root = PrefixMapping.Factory.create(); pm.setNsPrefix( "a", "aPrefix:" ); pm.setNsPrefix( "b", "bPrefix:" ); root.setNsPrefix( "a", "pootle:" ); root.setNsPrefix( "z", "bPrefix:" ); root.setNsPrefix( "c", "cootle:" ); assertSame( pm, pm.withDefaultMappings( root ) ); assertEquals( "aPrefix:", pm.getNsPrefixURI( "a" ) ); assertEquals( null, pm.getNsPrefixURI( "z" ) ); assertEquals( "bPrefix:", pm.getNsPrefixURI( "b" ) ); assertEquals( "cootle:", pm.getNsPrefixURI( "c" ) ); }