public static Path parse(String str, PrefixMapping pmap) { return parse(str, new Prologue(pmap)) ; }
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); }
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 URI getEventContainerURIforConnectionURI(URI connectionURI, LinkedDataSource linkedDataSource) { assert linkedDataSource != null : "linkedDataSource must not be null"; Dataset dataset = getDatalForResource(connectionURI, linkedDataSource); Path propertyPath = PathParser.parse("<" + WON.HAS_EVENT_CONTAINER+ ">", PrefixMapping.Standard); return RdfUtils.getURIPropertyForPropertyPath(dataset, connectionURI, propertyPath); }
public static URI getRemoteConnectionURIforConnectionURI(URI connectionURI, LinkedDataSource linkedDataSource) { assert linkedDataSource != null : "linkedDataSource must not be null"; Dataset dataset = getDatalForResource(connectionURI, linkedDataSource); Path propertyPath = PathParser.parse("<" + WON.HAS_REMOTE_CONNECTION + ">", PrefixMapping.Standard); return RdfUtils.getURIPropertyForPropertyPath(dataset, connectionURI, propertyPath); }
public static URI getEventContainerURIforNeedURI(URI needURI, LinkedDataSource linkedDataSource) { assert linkedDataSource != null : "linkedDataSource must not be null"; Dataset dataset = getDatalForResource(needURI, linkedDataSource); Path propertyPath = PathParser.parse("<" + WON.HAS_EVENT_CONTAINER+ ">", PrefixMapping.Standard); return RdfUtils.getURIPropertyForPropertyPath(dataset, needURI, propertyPath); }
public static URI getConnectionState(Dataset connectionDataset, URI connectionUri) { Path statePath = PathParser.parse("won:hasConnectionState", DefaultPrefixUtils.getDefaultPrefixes()); return RdfUtils.getURIPropertyForPropertyPath(connectionDataset, connectionUri, statePath); }
public static URI getConnectionStateforConnectionURI(URI connectionURI, LinkedDataSource linkedDataSource) { assert linkedDataSource != null : "linkedDataSource must not be null"; Dataset dataset = getDatalForResource(connectionURI, linkedDataSource); Path propertyPath = PathParser.parse("<" + WON.HAS_CONNECTION_STATE+ ">", PrefixMapping.Standard); return RdfUtils.getURIPropertyForPropertyPath(dataset, connectionURI, propertyPath); }
public static URI getNeedURIforConnectionURI(URI connectionURI, LinkedDataSource linkedDataSource) { assert linkedDataSource != null : "linkedDataSource must not be null"; Dataset dataset = getDatalForResource(connectionURI, linkedDataSource); Path propertyPath = PathParser.parse("<" + WON.BELONGS_TO_NEED + ">", PrefixMapping.Standard); return RdfUtils.getURIPropertyForPropertyPath(dataset, connectionURI, propertyPath); }
public static URI getRemoteNeedURIforConnectionURI(URI connectionURI, LinkedDataSource linkedDataSource) { assert linkedDataSource != null : "linkedDataSource must not be null"; Dataset dataset = getDatalForResource(connectionURI, linkedDataSource); Path propertyPath = PathParser.parse("<" + WON.HAS_REMOTE_NEED + ">", PrefixMapping.Standard); return RdfUtils.getURIPropertyForPropertyPath(dataset, connectionURI, propertyPath); }
public Set<String> getMatcherProtocolTopicNamesWithResource(URI resourceURI){ Set<String> activeMQMatcherProtocolTopicNames = new HashSet<>(); resourceURI = URI.create(resourceURI.toString()+pathInformation); for (int i = 0; i< matcherProtocolTopicList.size();i++){ try{ Path path = PathParser.parse(matcherProtocolTopicList.get(i),PrefixMapping.Standard); activeMQMatcherProtocolTopicNames.add(RdfUtils.getStringPropertyForPropertyPath( linkedDataSource.getDataForResource(resourceURI), resourceURI, path )); }catch (HttpClientErrorException e){ if (e.getStatusCode() == HttpStatus.NOT_FOUND){ return null; } else throw e; } } return activeMQMatcherProtocolTopicNames; } public void setLinkedDataSource(final LinkedDataSource linkedDataSource)
public final Set<String> getMatcherProtocolTopicNamesWithResource(URI resourceURI){ Set<String> activeMQMatcherProtocolTopicNames = new HashSet<>(); for (int i = 0; i< matcherProtocolTopicList.size();i++){ try{ Path path = PathParser.parse(matcherProtocolTopicList.get(i),PrefixMapping.Standard); activeMQMatcherProtocolTopicNames.add(RdfUtils.getStringPropertyForPropertyPath( linkedDataSource.getDataForResource(resourceURI), resourceURI, path )); }catch (HttpClientErrorException e){ if (e.getStatusCode() == HttpStatus.NOT_FOUND){ return null; } else throw e; } } return activeMQMatcherProtocolTopicNames; }
private Node getContentPropertyObject(NeedContentPropertyType type, String propertyPath) { Path path = PathParser.parse(propertyPath, DefaultPrefixUtils.getDefaultPrefixes()); Collection<Resource> nodes = getContentNodes(type); if (nodes.size() != 1) { throw new IncorrectPropertyCountException("expected exactly one occurrence of object for property path " + propertyPath, 1, nodes.size()); } Node node = nodes.iterator().next().asNode(); return RdfUtils.getNodeForPropertyPath(getNeedModel(), node, path); }
String rdfPropertyStr = iri.value(); result = (P_Path0)PathParser.parse(rdfPropertyStr, pm);
try{ logger.debug("trying to get broker endpoint for {} on resource {}", protocolType, resourceUri); Path path = PathParser.parse(PATH_BROKER_URI, PrefixMapping.Standard); Dataset resourceDataset = linkedDataSource.getDataForResource(resourceUri); logger.debug("ResourceModel for {}: {}", resourceUri, resourceDataset);
try{ logger.debug("trying to get queue name prototol type {} on resource {}", protocolType, resourceUri); Path path = PathParser.parse(queueNamePath, PrefixMapping.Standard);
final Path p = PathParser.parse((String) o, pMapping); if (p instanceof P_Link)
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)); CrawlCommandEvent crawlNeedCommandEvent = new CrawlCommandEvent(command.getNeedURI(), command.getNeedURI(), propertyPaths, 10000, 5); 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: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: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)); CrawlCommandEvent crawlConnectionCommandEvent = new CrawlCommandEvent(command.getNeedURI(), command.getConnectionURI(), propertyPaths, 10000, 5);
final Path p = PathParser.parse((String) o, pMapping); if (p instanceof P_Link)