public boolean isIdentifiedBy(URI uri){ if (uri == null) return false; return getResource().getURI().toString().equals(uri.toString()); }
public URI getURI(){ return URI.create(getResource().getURI().toString()); }
WonCamelConstants.MESSAGE_HEADER +"' or in the body"); exchange.getIn().setHeader(WonCamelConstants.MESSAGE_TYPE_HEADER, URI.create(wonMessage.getMessageType().getResource().getURI())); exchange.getIn().setHeader(WonCamelConstants.MESSAGE_HEADER, wonMessage); exchange.getIn().setBody(null);
messageEventResource.addProperty(WONMSG.HAS_MESSAGE_TYPE_PROPERTY, wonMessageType.getResource()); envelopeGraph.createResource(isResponseToMessageURI.toString())); messageEventResource.addProperty( WONMSG.IS_RESPONSE_TO_MESSAGE_TYPE, this.isResponseToMessageType.getResource()); if (isRemoteResponseToMessageURI != null) { messageEventResource.addProperty(
/** * Converts the specified hint message into a Match object. * @param wonMessage * @return a match object or null if the message is not a hint message. */ public static Match toMatch(final WonMessage wonMessage) { if (!WONMSG.TYPE_HINT.equals(wonMessage.getMessageType().getResource())){ return null; } Match match = new Match(); match.setFromNeed(wonMessage.getReceiverNeedURI()); Dataset messageContent = wonMessage.getMessageContent(); RDFNode score = findOnePropertyFromResource(messageContent, wonMessage.getMessageURI(), WON.HAS_MATCH_SCORE); if (!score.isLiteral()) return null; match.setScore(score.asLiteral().getDouble()); RDFNode counterpart = findOnePropertyFromResource(messageContent, wonMessage.getMessageURI(), WON.HAS_MATCH_COUNTERPART); if (!counterpart.isResource()) return null; match.setToNeed(URI.create(counterpart.asResource().getURI())); return match; }