Skip to content

Commit

Permalink
Merge branch 'explanation' into dev
Browse files Browse the repository at this point in the history
  • Loading branch information
sarthou committed Nov 26, 2024
2 parents c2229a8 + c6be0cc commit 9855749
Show file tree
Hide file tree
Showing 40 changed files with 1,316 additions and 173 deletions.
28 changes: 28 additions & 0 deletions docs/cpp_API/IndividualClient.html
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,22 @@ <h2 id="public-functions">Public Functions</h2>
<td class="memItemLeft rightAlign topAlign"> std::vector&lt;std::string&gt; </td>
<td class="memItemRight bottomAlign"><b><a href="IndividualClient.html#getRangeOf">getRangeOf</a></b>(const std::string&amp; <i>name</i>, const std::string&amp; <i>selector</i> = "", int <i>depth</i> = -1)</td>
</tr>
<tr>
<td class="memItemLeft rightAlign topAlign"> bool </td>
<td class="memItemRight bottomAlign"><b><a href="IndividualClient.html#isInferred">isInferred</a></b>(const std::string&amp; <i>subject</i>, const std::string&amp; <i>property</i>, const std::string&amp; <i>object</i>)</td>
</tr>
<tr>
<td class="memItemLeft rightAlign topAlign"> bool </td>
<td class="memItemRight bottomAlign"><b><a href="IndividualClient.html#isInferred2">isInferred</a></b>(const std::string&amp; <i>subject</i>, const std::string&amp; <i>class_name</i>)</td>
</tr>
<tr>
<td class="memItemLeft rightAlign topAlign"> std::vector&lt;std::string&gt; </td>
<td class="memItemRight bottomAlign"><b><a href="IndividualClient.html#getInferenceExplanation">getInferenceExplanation</a></b>(const std::string&amp; <i>subject</i>, const std::string&amp; <i>property</i>, const std::string&amp; <i>object</i>)</td>
</tr>
<tr>
<td class="memItemLeft rightAlign topAlign"> std::vector&lt;std::string&gt; </td>
<td class="memItemRight bottomAlign"><b><a href="IndividualClient.html#getInferenceExplanation2">getInferenceExplanation</a></b>(const std::string&amp; <i>subject</i>, const std::string&amp; <i>class_name</i>)</td>
</tr>
</tbody>
</table>
</div>
Expand Down Expand Up @@ -288,6 +304,18 @@ <h3 class="fn" id="getRangeOf"><a name="getRangeOf"></a><span class="type">std::
<p>The optional <i>selector</i> parameter can be set to only get results inheriting from the <i>selector</i> property. The default value &quot;&quot; represents no restriction on the result.</p>
<p>The optional <i>depth</i> parameter can be set to limit tree propagation of the individual to a specific value. The default value -1 represents no propagation limitation.</p>

<h3 class="fn" id="isInferred"><a name="isInferred"></a><span class="type">bool</span> IndividualClient::<span class="name">isInferred</span>(const <span class="type">std::string</span>&amp; <i>subject</i>, const <span class="type">std::string</span>&amp; <i>property</i>, const <span class="type">std::string</span>&amp; <i>object</i>)</h3>
<p>Tests if the relation has been inferred or not.</p>

<h3 class="fn" id="isInferred2"><a name="isInferred"></a><span class="type">bool</span> IndividualClient::<span class="name">isInferred</span>(const <span class="type">std::string</span>&amp; <i>subject</i>, const <span class="type">std::string</span>&amp; <i>class_name</i>)</h3>
<p>Tests if the inheritance has been inferred or not.</p>

<h3 class="fn" id="getInferenceExplanation"><a name="getInferenceExplanation"></a><span class="type">std::vector&lt;std::string&gt;</span> IndividualClient::<span class="name">getInferenceExplanation</span>(const <span class="type">std::string</span>&amp; <i>subject</i>, const <span class="type">std::string</span>&amp; <i>property</i>, const <span class="type">std::string</span>&amp; <i>object</i>)</h3>
<p>Gives all the relations used in the inference of the provided relation.</p>

<h3 class="fn" id="getInferenceExplanation2"><a name="getInferenceExplanation"></a><span class="type">std::vector&lt;std::string&gt;</span> IndividualClient::<span class="name">getInferenceExplanation</span>(const <span class="type">std::string</span>&amp; <i>subject</i>, const <span class="type">std::string</span>&amp; <i>class_name</i>)</h3>
<p>Gives all the relations used in the inference of the provided inheritage.</p>

</div>
</div>
</div>
Expand Down
32 changes: 31 additions & 1 deletion docs/cpp_API/IndividualIndexClient.html
Original file line number Diff line number Diff line change
Expand Up @@ -208,6 +208,22 @@ <h2 id="public-functions">Public Functions</h2>
<td class="memItemLeft rightAlign topAlign"> std::vector&lt;int64_t&gt; </td>
<td class="memItemRight bottomAlign"><b><a href="IndividualIndexClient.html#getRangeOf">getRangeOf</a></b>(int64_t <i>index</i>, int64_t <i>selector</i> = 0, int <i>depth</i> = -1)</td>
</tr>
<tr>
<td class="memItemLeft rightAlign topAlign"> bool </td>
<td class="memItemRight bottomAlign"><b><a href="IndividualIndexClient.html#isInferred">isInferred</a></b>(int64_t <i>subject</i>, int64_t <i>property</i>, int64_t <i>object</i>)</td>
</tr>
<tr>
<td class="memItemLeft rightAlign topAlign"> bool </td>
<td class="memItemRight bottomAlign"><b><a href="IndividualIndexClient.html#isInferred2">isInferred</a></b>(int64_t <i>subject</i>, int64_t <i>class_index</i>)</td>
</tr>
<tr>
<td class="memItemLeft rightAlign topAlign"> std::vector&lt;std::string&gt; </td>
<td class="memItemRight bottomAlign"><b><a href="IndividualIndexClient.html#getInferenceExplanation">getInferenceExplanation</a></b>(int64_t <i>subject</i>, int64_t <i>property</i>, int64_t <i>object</i>)</td>
</tr>
<tr>
<td class="memItemLeft rightAlign topAlign"> std::vector&lt;std::string&gt; </td>
<td class="memItemRight bottomAlign"><b><a href="IndividualIndexClient.html#getInferenceExplanation2">getInferenceExplanation</a></b>(int64_t <i>subject</i>, int64_t <i>class_index</i>)</td>
</tr>
</tbody>
</table>
</div>
Expand Down Expand Up @@ -287,11 +303,25 @@ <h3 class="fn" id="getDomainOf"><a name="getDomainOf"></a><span class="type">std
<p>The optional <i>selector</i> parameter can be set to only get results inheriting from the <i>selector</i> property. The default value &quot;&quot; represents no restriction on the result.</p>
<p>The optional <i>depth</i> parameter can be set to limit tree propagation of the individual to a specific value. The default value -1 represents no propagation limitation.</p>

<h3 class="fn" id="getRangeOf"><a name="getRangeOf"></a><span class="type">std::vector&lt;int64_t&gt;</span> IndividualIndexClient::<span class="name">getRangeOf</span>(<span class="type">int64_tg</span> <i>index</i>, <span class="type">int64_t</span> <i>selector</i> = 0, <span class="type">int</span> <i>depth</i> = -1)</h3>
<h3 class="fn" id="getRangeOf"><a name="getRangeOf"></a><span class="type">std::vector&lt;int64_t&gt;</span> IndividualIndexClient::<span class="name">getRangeOf</span>(<span class="type">int64_t</span> <i>index</i>, <span class="type">int64_t</span> <i>selector</i> = 0, <span class="type">int</span> <i>depth</i> = -1)</h3>
<p>Gives all the properties for which the individual <i>index</i> is part of the range.</p>
<p>The optional <i>selector</i> parameter can be set to only get results inheriting from the <i>selector</i> property. The default value &quot;&quot; represents no restriction on the result.</p>
<p>The optional <i>depth</i> parameter can be set to limit tree propagation of the individual to a specific value. The default value -1 represents no propagation limitation.</p>

<h3 class="fn" id="isInferred"><a name="isInferred"></a><span class="type">bool</span> IndividualIndexClient::<span class="name">isInferred</span>(<span class="type">int64_t</span> <i>subject</i>, <span class="type">int64_t</span> <i>property</i>, <span class="type">int64_t</span> <i>object</i>)</h3>
<p>Tests if the relation has been inferred or not.</p>

<h3 class="fn" id="isInferred2"><a name="isInferred"></a><span class="type">bool</span> IndividualIndexClient::<span class="name">isInferred</span>(<span class="type">int64_t</span> <i>subject</i>, <span class="type">int64_t</span> <i>class_index</i>)</h3>
<p>Tests if the inheritance has been inferred or not.</p>

<h3 class="fn" id="getInferenceExplanation"><a name="getInferenceExplanation"></a><span class="type">std::vector&lt;std::string&gt;</span> IndividualIndexClient::<span class="name">getInferenceExplanation</span>(<span class="type">int64_t</span> <i>subject</i>, <span class="type">int64_t</span> <i>property</i>, <span class="type">int64_t</span> <i>object</i>)</h3>
<p>Gives all the relations used in the inference of the provided relation.</p>
<p>Relations are returned in their string form.</p>

<h3 class="fn" id="getInferenceExplanation2"><a name="getInferenceExplanation"></a><span class="type">std::vector&lt;std::string&gt;</span> IndividualIndexClient::<span class="name">getInferenceExplanation</span>(<span class="type">int64_t</span> <i>subject</i>, <span class="type">int64_t</span> <i>class_index</i>)</h3>
<p>Gives all the relations used in the inference of the provided inheritage.</p>
<p>Relations are returned in their string form.</p>

</div>
</div>
</div>
Expand Down
28 changes: 28 additions & 0 deletions docs/python_API/IndividualClient.html
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,22 @@ <h2 id="methods">Methods</h2>
<td class="memItemLeft rightAlign topAlign"> str[] </td>
<td class="memItemRight bottomAlign"><b><a href="IndividualClient.html#getRangeOf">getRangeOf</a></b>(self, name, selector = '', depth = -1)</td>
</tr>
<tr>
<td class="memItemLeft rightAlign topAlign"> bool </td>
<td class="memItemRight bottomAlign"><b><a href="IndividualClient.html#isRelationInferred">isRelationInferred</a></b>(self, subject, property, object)</td>
</tr>
<tr>
<td class="memItemLeft rightAlign topAlign"> bool </td>
<td class="memItemRight bottomAlign"><b><a href="IndividualClient.html#isInheritanceInferred">isInheritanceInferred</a></b>(self, subject, class_name)</td>
</tr>
<tr>
<td class="memItemLeft rightAlign topAlign"> str[] </td>
<td class="memItemRight bottomAlign"><b><a href="IndividualClient.html#getRelationInferenceExplanation">getRelationInferenceExplanation</a></b>(self, subject, property, object)</td>
</tr>
<tr>
<td class="memItemLeft rightAlign topAlign"> str[] </td>
<td class="memItemRight bottomAlign"><b><a href="IndividualClient.html#getInheritanceInferenceExplanation">getInheritanceInferenceExplanation</a></b>(self, subject, class_name)</td>
</tr>
</tbody>
</table>
</div>
Expand Down Expand Up @@ -287,6 +303,18 @@ <h3 class="fn" id="getRangeOf"><a name="getRangeOf"></a><span class="name">getRa
<p>The optional <i>selector</i>(str) parameter can be set to only get results inheriting from the <i>selector</i> property. The default value '' represents no restriction on the result.</p>
<p>The optional <i>depth</i>(int) parameter can be set to limit tree propagation of the individual to a specific value. The default value -1 represents no propagation limitation.</p>

<h3 class="fn" id="isRelationInferred"><a name="isRelationInferred"></a><span class="name">isRelationInferred</span>(self, subject, property, object)</h3>
<p>Tests if the relation (str, str, str) has been inferred or not.</p>

<h3 class="fn" id="isInheritanceInferred"><a name="isInheritanceInferred"></a><span class="name">isInheritanceInferred</span>(self, subject, class_name)</h3>
<p>Tests if the inheritance (str, str) has been inferred or not.</p>

<h3 class="fn" id="getRelationInferenceExplanation"><a name="getRelationInferenceExplanation"></a><span class="name">getRelationInferenceExplanation</span>(self, subject, property, object)</h3>
<p>Gives all the relations (str[]) used in the inference of the provided relation (str, str, str).</p>

<h3 class="fn" id="getInheritanceInferenceExplanation"><a name="getInheritanceInferenceExplanation"></a><span class="name">getInheritanceInferenceExplanation</span>(self, subject, class_name)</h3>
<p>Gives all the relations (str[]) used in the inference of the provided inheritage (str, str).</p>

</div>
</div>
</div>
Expand Down
30 changes: 30 additions & 0 deletions docs/python_API/IndividualIndexClient.html
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,22 @@ <h2 id="methods">Methods</h2>
<td class="memItemLeft rightAlign topAlign"> integer[] </td>
<td class="memItemRight bottomAlign"><b><a href="IndividualIndexClient.html#getRangeOf">getRangeOf</a></b>(self, index, selector = 0, depth = -1)</td>
</tr>
<tr>
<td class="memItemLeft rightAlign topAlign"> bool </td>
<td class="memItemRight bottomAlign"><b><a href="IndividualIndexClient.html#isRelationInferred">isRelationInferred</a></b>(self, subject, property, object)</td>
</tr>
<tr>
<td class="memItemLeft rightAlign topAlign"> bool </td>
<td class="memItemRight bottomAlign"><b><a href="IndividualIndexClient.html#isInheritanceInferred">isInheritanceInferred</a></b>(self, subject, class_index)</td>
</tr>
<tr>
<td class="memItemLeft rightAlign topAlign"> str[] </td>
<td class="memItemRight bottomAlign"><b><a href="IndividualIndexClient.html#getRelationInferenceExplanation">getRelationInferenceExplanation</a></b>(self, subject, property, object)</td>
</tr>
<tr>
<td class="memItemLeft rightAlign topAlign"> str[] </td>
<td class="memItemRight bottomAlign"><b><a href="IndividualIndexClient.html#getInheritanceInferenceExplanation">getInheritanceInferenceExplanation</a></b>(self, subject, class_index)</td>
</tr>
</tbody>
</table>
</div>
Expand Down Expand Up @@ -291,6 +307,20 @@ <h3 class="fn" id="getRangeOf"><a name="getRangeOf"></a><span class="name">getRa
<p>The optional <i>selector</i>(integer) parameter can be set to only get results inheriting from the <i>selector</i> property. The default value 0 represents no restriction on the result.</p>
<p>The optional <i>depth</i>(int) parameter can be set to limit tree propagation of the individual to a specific value. The default value -1 represents no propagation limitation.</p>

<h3 class="fn" id="isRelationInferred"><a name="isRelationInferred"></a><span class="name">isRelationInferred</span>(self, subject, property, object)</h3>
<p>Tests if the relation (integer, integer, integer) has been inferred or not.</p>

<h3 class="fn" id="isInheritanceInferred"><a name="isInheritanceInferred"></a><span class="name">isInheritanceInferred</span>(self, subject, class_index)</h3>
<p>Tests if the inheritance (integer, integer) has been inferred or not.</p>

<h3 class="fn" id="getRelationInferenceExplanation"><a name="getRelationInferenceExplanation"></a><span class="name">getRelationInferenceExplanation</span>(self, subject, property, object)</h3>
<p>Gives all the relations (str[]) used in the inference of the provided relation (integer, integer, integer).</p>
<p>Relations are returned in their string form.</p>

<h3 class="fn" id="getInheritanceInferenceExplanation"><a name="getInheritanceInferenceExplanation"></a><span class="name">getInheritanceInferenceExplanation</span>(self, subject, class_index)</h3>
<p>Gives all the relations (str[]) used in the inference of the provided inheritage (integer, integer).</p>
<p>Relations are returned in their string form.</p>

</div>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion docs/todo.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
[X] Chain add explanations for same_as and inheritance over properties
[X] Handle same_as for trace leaving in chains and anonymous
[X] Handle Branch_t->mothers in trace leaving for Class and Properties inheritance
[X] erase traces for new relations stated by user and previously infered
[X] erase traces for new relations stated by user and previously inferred
[X] in Feeder, implement the remove method for modifyInheritance
[X] check use of has_induced_inheritance_relations and has_induced_object_relations on all remove
[X] inheritance insertion does not trigger reasoning (chain and anonymous)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,29 @@ namespace onto {
/// @return a vector of identifiers of individuals.
std::vector<std::string> getDistincts(const std::string& name);

/// @brief Tests if the relation has been inferred or not.
/// @param subject the subject of the relation.
/// @param property the property of the relation.
/// @param object the object of the relation. Can be an individual or a data (type#value)
/// @return true if the relation has been inferred.
bool isInferred(const std::string& subject, const std::string& property, const std::string& object);
/// @brief Tests if the relation has been inferred or not.
/// @param subject the subject of the relation.
/// @param class_name the class the subject inherite.
/// @return true if the relation has been inferred.
bool isInferred(const std::string& subject, const std::string& class_name);
/// @brief Gives all the relations used in the inference of the provided relation.
/// @param subject the subject of the relation.
/// @param property the property of the relation.
/// @param object the object of the relation. Can be an individual or a data (type#value)
/// @return a vector of relation in the form `subject|predicate|object|`
std::vector<std::string> getInferenceExplanation(const std::string& subject, const std::string& property, const std::string& object);
/// @brief Gives all the relations used in the inference of the provided inheritage.
/// @param subject the subject of the relation.
/// @param class_name the class the subject inherite.
/// @return a vector of relation in the form `subject|predicate|object|`
std::vector<std::string> getInferenceExplanation(const std::string& subject, const std::string& class_name);

private:
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,6 +104,31 @@ namespace onto {
/// @return a vector of identifiers of individuals.
std::vector<int64_t> getDistincts(int64_t index);

/// @brief Tests if the relation has been inferred or not.
/// @param subject the subject of the relation.
/// @param property the property of the relation.
/// @param object the object of the relation. Can be an individual or a data (type#value)
/// @return true if the relation has been inferred.
bool isInferred(int64_t subject, int64_t property, int64_t object);
/// @brief Tests if the relation has been inferred or not.
/// @param subject the subject of the relation.
/// @param class_index the class the subject inherite.
/// @return true if the relation has been inferred.
bool isInferred(int64_t subject, int64_t class_index);
/// @brief Gives all the relations used in the inference of the provided relation.
/// @param subject the subject of the relation.
/// @param property the property of the relation.
/// @param object the object of the relation. Can be an individual or a data (type#value)
/// @return a vector of relation in the form `subject|predicate|object|`
/// Relations are returned in their string form.
std::vector<std::string> getInferenceExplanation(int64_t subject, int64_t property, int64_t object);
/// @brief Gives all the relations used in the inference of the provided inheritage.
/// @param subject the subject of the relation.
/// @param class_index the class the subject inherite.
/// @return a vector of relation in the form `subject|predicate|object|`
/// Relations are returned in their string form.
std::vector<std::string> getInferenceExplanation(int64_t subject, int64_t class_index);

private:
};

Expand Down
Loading

0 comments on commit 9855749

Please sign in to comment.