Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* {@code pattern}.
*
* In other words, the {@link KnowledgeBase} can answer those kinds of questions
* for its {@link SmartConnectorImpl}.
* for its {@link SmartConnector}.
*/
public final class AnswerKnowledgeInteraction extends KnowledgeInteraction {

Expand Down Expand Up @@ -35,7 +35,7 @@ public AnswerKnowledgeInteraction(CommunicativeAct anAct, GraphPattern aPattern,

/**
* Create an {@link AnswerKnowledgeInteraction}. See
* {@link KnowledgeInteraction#KnowledgeInteraction(CommunicativeAct, String, boolean, boolean, MatchStrategy)
* {@link KnowledgeInteraction#KnowledgeInteraction(CommunicativeAct, String, boolean, boolean, boolean, MatchStrategy)}
*
* @param aPattern The {@link GraphPattern} expresses the 'shape' of knowledge
* that this {@link KnowledgeInteraction} can provide.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* {@code pattern}.
*
* In other words, the {@link KnowledgeBase} asks these kinds of questions to
* its {@link SmartConnectorImpl}.
* its {@link SmartConnector}.
*/
public final class AskKnowledgeInteraction extends KnowledgeInteraction {

Expand Down Expand Up @@ -36,7 +36,7 @@ public AskKnowledgeInteraction(CommunicativeAct act, GraphPattern pattern, boole

/**
* Create a {@link AskKnowledgeInteraction}. See
* {@link KnowledgeInteraction#KnowledgeInteraction(CommunicativeAct, String, boolean, boolean, MatchStrategy)
* {@link KnowledgeInteraction#KnowledgeInteraction(CommunicativeAct, String, boolean, boolean, boolean, MatchStrategy)}.
*
* @param pattern The {@link GraphPattern} expresses the 'shape' of knowledge
* that this {@link KnowledgeInteraction} asks for.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,8 @@

/**
* A {@link GraphPattern} expresses a 'shape' of knowledge. We use Basic Graph
* Pattern syntax from SPARQL 1.1
* {@linkplain https://www.w3.org/TR/sparql11-query/} to represent this
* knowledge.
* Pattern syntax from <a href="https://www.w3.org/TR/sparql11-query/">SPARQL
* 1.1</a> to represent this knowledge.
*
* It is a conjunction of triple patterns, where each triple pattern consists of
* a {@code subject}, {@code predicate} and {@code object}. Each of these can be
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* to be present in order to satisfy an ask/post interaction.
*
* Note that there can be multiple knowledge gaps in an ask or post interaction.
* They will be combined in a Set<KnowledgeGap>s that contains one or more
* They will be combined in a {@code Set<KnowledgeGap>}s that contains one or more
* {@link KnowledgeGap}s in an <i><b>OR</b></i> fashion.
*
* */
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

/**
* A {@link KnowledgeInteraction} represents an agreement about the exchange of
* knowledge between the {@link SmartConnectorImpl} and the
* knowledge between the {@link SmartConnector} and the
* {@link KnowledgeBase}. It expresses the 'shape' of knowledge that a
* {@link KnowledgeBase} asks from, or can provide to its
* {@link SmartConnectorImpl}.
* {@link SmartConnector}.
*/
public abstract class KnowledgeInteraction {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

/**
* A {@link ReactHandler} provides a handler method
* ({@link ReactHandler#react(ReactKnowledgeInteraction, BindingSet)}) that
* ({@link ReactHandler#react(ReactKnowledgeInteraction, ReactExchangeInfo)}) that
* returns a {@link BindingSet} for the provided input. Unlike in the
* {@link AnswerHandler}, which only has a single {@link GraphPattern}, the
* {@link GraphPattern} of the result *can* be different from the argument's.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,39 +10,38 @@ public interface SmartConnector {

/**
* This method is used by the {@link KnowledgeBase} to let its
* {@link SmartConnectorImpl} (and via it other {@link KnowledgeBase}s) know
* that it will ask certain types of questions for which it would like an
* answer. This allows the {@link SmartConnectorImpl} to prepare.
* {@link SmartConnector} (and via it other {@link KnowledgeBase}s) know that it
* will ask certain types of questions for which it would like an answer. This
* allows the {@link SmartConnector} to prepare.
*
* @param anAskKI The {@link AskKnowledgeInteraction} that the
* {@link KnowledgeBase} wants to register with this
* {@link SmartConnectorImpl}.
* {@link SmartConnector}.
*/
URI register(AskKnowledgeInteraction anAskKI);

/**
* This method is used by the {@link KnowledgeBase} to let its
* {@link SmartConnectorImpl} (and via it other {@link KnowledgeBase}s) know
* that it no longer will ask certain types of questions. This allows the
* {@link SmartConnectorImpl} to prepare.
* {@link SmartConnector} (and via it other {@link KnowledgeBase}s) know that it
* no longer will ask certain types of questions. This allows the
* {@link SmartConnector} to prepare.
*
* @param anAskKI The {@link AskKnowledgeInteraction} that the
* {@link KnowledgeBase} wants to unregister from this
* {@link SmartConnectorImpl}.
* {@link SmartConnector}.
*/
void unregister(AskKnowledgeInteraction anAskKI);

/**
* This method is used by the {@link KnowledgeBase} to let its
* {@link SmartConnectorImpl} (and via it other {@link KnowledgeBase}s) know
* that it can answer certain types of questions that other
* {@link KnowledgeBase}s would like to
* {@link #ask(AskKnowledgeInteraction, RecipientSelector, BindingSet)}. This
* allows the {@link SmartConnectorImpl} to prepare.
* {@link SmartConnector} (and via it other {@link KnowledgeBase}s) know that it
* can answer certain types of questions that other {@link KnowledgeBase}s would
* like to {@link #ask(AskKnowledgeInteraction, RecipientSelector, BindingSet)}.
* This allows the {@link SmartConnector} to prepare.
*
* @param anAnswerKI The {@link AskKnowledgeInteraction} that the
* {@link KnowledgeBase} wants to register with this
* {@link SmartConnectorImpl}.
* {@link SmartConnector}.
* @param aAnswerHandler The {@link AnswerHandler} that will process and answer
* an incoming question from another
* {@link KnowledgeBase}.
Expand All @@ -51,65 +50,64 @@ public interface SmartConnector {

/**
* This method is used by the {@link KnowledgeBase} to let its
* {@link SmartConnectorImpl} (and via it other {@link KnowledgeBase}s) know
* that it no longer answers certain types of questions. This allows the
* {@link SmartConnectorImpl} to prepare.
* {@link SmartConnector} (and via it other {@link KnowledgeBase}s) know that it
* no longer answers certain types of questions. This allows the
* {@link SmartConnector} to prepare.
*
* @param anAnswerKI The {@link AswerKnowledgeInteraction} that the
* @param anAnswerKI The {@link AnswerKnowledgeInteraction} that the
* {@link KnowledgeBase} wants to unregister from this
* {@link SmartConnectorImpl}.
* {@link SmartConnector}.
*/
void unregister(AnswerKnowledgeInteraction anAnswerKI);

/**
* This method is used by the {@link KnowledgeBase} to let its
* {@link SmartConnectorImpl} (and via it other {@link KnowledgeBase}s) know
* that it will post certain type of data in which other {@link KnowledgeBase}s
* might want to react. This allows the {@link SmartConnectorImpl} to prepare.
* {@link SmartConnector} (and via it other {@link KnowledgeBase}s) know that it
* will post certain type of data in which other {@link KnowledgeBase}s might
* want to react. This allows the {@link SmartConnector} to prepare.
*
* @param aPostKI The {@link PostKnowledgeInteraction} that the
* {@link KnowledgeBase} wants to register with this
* {@link SmartConnectorImpl}.
* {@link SmartConnector}.
*/
URI register(PostKnowledgeInteraction aPostKI);

/**
* This method is used by the {@link KnowledgeBase} to let its
* {@link SmartConnectorImpl} (and via it other {@link KnowledgeBase}s) know
* that it will no longer post certain types of data. This allows the
* {@link SmartConnectorImpl} to prepare.
* {@link SmartConnector} (and via it other {@link KnowledgeBase}s) know that it
* will no longer post certain types of data. This allows the
* {@link SmartConnector} to prepare.
*
* @param aPostKI The {@link PostKnowledgeInteraction} that the
* {@link KnowledgeBase} wants to unregister from this
* {@link SmartConnectorImpl}.
* {@link SmartConnector}.
*/
void unregister(PostKnowledgeInteraction aPostKI);

/**
* This method is used by the {@link KnowledgeBase} to let its
* {@link SmartConnectorImpl} (and via it other {@link KnowledgeBase}s) know
* that it wants to react to certain types of data that other
* {@link KnowledgeBase}s will
* {@link #post(PostKnowledgeInteraction, RecipientSelector, BindingSet)}. This
* allows the {@link SmartConnectorImpl} to prepare.
* {@link SmartConnector} (and via it other {@link KnowledgeBase}s) know that it
* wants to react to certain types of data that other {@link KnowledgeBase}s
* will {@link #post(PostKnowledgeInteraction, RecipientSelector, BindingSet)}.
* This allows the {@link SmartConnector} to prepare.
*
* @param anReactKI The {@link AskKnowledgeInteraction} that the
* {@link KnowledgeBase} wants to register with this
* {@link SmartConnectorImpl}.
* {@link SmartConnector}.
* @param aReactHandler The {@link AnswerHandler} that will process and answer
* an incoming question from another {@link KnowledgeBase}.
*/
URI register(ReactKnowledgeInteraction anReactKI, ReactHandler aReactHandler);

/**
* This method is used by the {@link KnowledgeBase} to let its
* {@link SmartConnectorImpl} (and via it other {@link KnowledgeBase}s) know
* that it no longer reacts to certain types of data. This allows the
* {@link SmartConnectorImpl} to prepare.
* {@link SmartConnector} (and via it other {@link KnowledgeBase}s) know that it
* no longer reacts to certain types of data. This allows the
* {@link SmartConnector} to prepare.
*
* @param anReactKI The {@link ReactKnowledgeInteraction} that the
* {@link KnowledgeBase} wants to unregister from this
* {@link SmartConnectorImpl}.
* {@link SmartConnector}.
*/
void unregister(ReactKnowledgeInteraction anReactKI);

Expand All @@ -123,14 +121,14 @@ public interface SmartConnector {

/**
* With this method a {@link KnowledgeBase} can ask a question to its
* {@link SmartConnectorImpl}. The Smart Connector will first check which of all
* the other {@link KnowledgeBase}s fit the {@link RecipientSelector} and
* {@link SmartConnector}. The Smart Connector will first check which of all the
* other {@link KnowledgeBase}s fit the {@link RecipientSelector} and
* subsequently determine whether those that fit the selector have a compatible
* or matching {@link AnswerKnowledgeInteraction}. The resulting other
* {@link KnowledgeBase}s will have their matching
* {@link AnswerKnowledgeInteraction}'s {@link AnswerHandler} triggered. If
* there are multiple matching {@link KnowledgeBase}s this
* {@link SmartConnectorImpl} will combine their results.
* {@link SmartConnector} will combine their results.
*
* Using the {@link BindingSet} argument the caller can limit the question being
* asked by providing one or more allowed values for the answers to certain
Expand All @@ -142,7 +140,7 @@ public interface SmartConnector {
* might take a while.
*
* @param anAKI The given {@link AskKnowledgeInteraction} should be
* registered with the {@link SmartConnectorImpl} via the
* registered with the {@link SmartConnector} via the
* {@link #register(AskKnowledgeInteraction)} method.
* @param aSelector A selector that allows the {@link KnowledgeBase} to limit
* the potential recipients that can answer the question. It
Expand All @@ -157,7 +155,7 @@ public interface SmartConnector {
* {@link AskKnowledgeInteraction}. Cannot be null!
* @return A {@link CompletableFuture} that will return a {@link AskResult} in
* the future when the question is successfully processed by the
* {@link SmartConnectorImpl}.
* {@link SmartConnector}.
*/
CompletableFuture<AskResult> ask(AskKnowledgeInteraction anAKI, RecipientSelector aSelector,
BindingSet aBindingSet);
Expand All @@ -168,10 +166,10 @@ CompletableFuture<AskResult> ask(AskKnowledgeInteraction anAKI, RecipientSelecto
* wildcard {@link RecipientSelector}. This means that all
* {@link KnowledgeBase}s that have matching {@link KnowledgeInteraction}s are
* allowed to answer the question being asked. This is the most interoperable
* way in using the {@link SmartConnectorImpl}, because it allows any compatible
* way in using the {@link SmartConnector}, because it allows any compatible
* {@link KnowledgeBase} to join the data exchange.
*
* @see SmartConnectorImpl#ask(AskKnowledgeInteraction, RecipientSelector,
* @see SmartConnector#ask(AskKnowledgeInteraction, RecipientSelector,
* BindingSet)
* @see SmartConnector#planAsk(AskKnowledgeInteraction, RecipientSelector,
* BindingSet)
Expand All @@ -184,21 +182,20 @@ CompletableFuture<AskResult> ask(AskKnowledgeInteraction anAKI, RecipientSelecto
*
* @param aPKI
* @param aSelector
* @param someArguments
* @return
*/
PostPlan planPost(PostKnowledgeInteraction aPKI, RecipientSelector aSelector);

/**
* With this method a {@link KnowledgeBase} can post data to its
* {@link SmartConnectorImpl}. The Smart Connector will first check which of all
* the other {@link KnowledgeBase}s fit the {@link RecipientSelector} and
* {@link SmartConnector}. The Smart Connector will first check which of all the
* other {@link KnowledgeBase}s fit the {@link RecipientSelector} and
* subsequently determine whether those that fit the selector have a compatible
* or matching {@link ReactKnowledgeInteraction}. The resulting other
* {@link KnowledgeBase}s will have their matching
* {@link ReactKnowledgeInteraction}'s {@link ReactHandler} triggered. If there
* are multiple matching {@link KnowledgeBase}s this {@link SmartConnectorImpl}
* will allow all of them to react.
* are multiple matching {@link KnowledgeBase}s this {@link SmartConnector} will
* allow all of them to react.
*
* This type of interaction can be used to make interoperable publish/subscribe
* like mechanisms where the post is the publish and the react (without a
Expand All @@ -224,7 +221,7 @@ CompletableFuture<AskResult> ask(AskKnowledgeInteraction anAKI, RecipientSelecto
* take a while.
*
* @param aPKI The given {@link AskKnowledgeInteraction} should be
* registered with the {@link SmartConnectorImpl} via the
* registered with the {@link SmartConnector} via the
* {@link #register(AskKnowledgeInteraction)} method.
* @param aSelector A selector that allows the {@link KnowledgeBase} to
* limit the potential recipients that can answer the
Expand All @@ -240,7 +237,7 @@ CompletableFuture<AskResult> ask(AskKnowledgeInteraction anAKI, RecipientSelecto
* {@link AskKnowledgeInteraction}.
* @return A {@link CompletableFuture} that will return a {@link PostResult} in
* the future when the post is successfully processed by the
* {@link SmartConnectorImpl}.
* {@link SmartConnector}.
*
* @see SmartConnector#planPost(PostKnowledgeInteraction, RecipientSelector,
* BindingSet)
Expand All @@ -254,7 +251,7 @@ CompletableFuture<PostResult> post(PostKnowledgeInteraction aPKI, RecipientSelec
* wildcard {@link RecipientSelector}. This means that all
* {@link KnowledgeBase}s that have matching {@link KnowledgeInteraction}s are
* allowed to answer the question being asked. This is the most interoperable
* way in using the {@link SmartConnectorImpl}, because it allows any compatible
* way in using the {@link SmartConnector}, because it allows any compatible
* {@link KnowledgeBase} to join the data exchange.
*
* @see #post(PostKnowledgeInteraction, RecipientSelector, BindingSet)
Expand Down Expand Up @@ -290,22 +287,22 @@ CompletableFuture<PostResult> post(PostKnowledgeInteraction aPKI, RecipientSelec
boolean isReasonerEnabled();

/**
* Stops the current {@link SmartConnectorImpl}. Note that this methods is
* Stops the current {@link SmartConnector}. Note that this methods is
* asynchronous and will call
* {@link KnowledgeBase#smartConnectorStopped(SmartConnectorImpl)} when this
* smart connector has successfully stopped.
* {@link KnowledgeBase#smartConnectorStopped(SmartConnector)} when this smart
* connector has successfully stopped.
*
* After it has stopped, the {@link SmartConnectorImpl} can no longer be used by
* its {@link KnowledgeBase} to exchange data and the {@link KnowledgeBase}
* itself is no longer available to other {@link KnowledgeBase} for
* interoperable data exchange.
* After it has stopped, the {@link SmartConnector} can no longer be used by its
* {@link KnowledgeBase} to exchange data and the {@link KnowledgeBase} itself
* is no longer available to other {@link KnowledgeBase} for interoperable data
* exchange.
*
* Between calling this method and having the
* {@link KnowledgeBase#smartConnectorStopped(SmartConnectorImpl)} method
* called, its methods should not be called and the behaviour of the
* {@link SmartConnectorImpl} is unpredictable.
* {@link KnowledgeBase#smartConnectorStopped(SmartConnector)} method called,
* its methods should not be called and the behaviour of the
* {@link SmartConnector} is unpredictable.
*
* Note that a stopped {@link SmartConnectorImpl} can no longer be used.
* Note that a stopped {@link SmartConnector} can no longer be used.
*/
void stop();

Expand Down
Loading