Skip to content
This repository has been archived by the owner on Feb 17, 2022. It is now read-only.

api: optional recursion of transitive relations #49

Closed
tiborsimko opened this issue Sep 3, 2015 · 0 comments · Fixed by #66
Closed

api: optional recursion of transitive relations #49

tiborsimko opened this issue Sep 3, 2015 · 0 comments · Fixed by #66
Assignees
Labels
Milestone

Comments

@tiborsimko
Copy link
Member

Background

Consider the following set of claims:

id claimant subject  predicate     object   certainty
-- -------- -------  ------------- -------- ---------
01 arXiv    arXiv1   is_variant_of  DOI1       0.8
02 INSPIRE  arXiv1   is_same_as    INSPIRE1    1.0
03 INSPIRE  INSPIRE1 is_same_as    bibcode1    1.0

The is_same_as predicate represents strong equality, is_variant_of weaker
equality. Both relations are transitive, meaning that if x R y and y R z, then x
R z.

Approach 1: iterative queries client-side

Imagine the following query:

GET /claims?type=bibcode&value=bibcode1

that basically asks "who does know anything about bibcode1"?

From the raw claim matching point of view, this query should return only the
claim number 03, which was inputted using bibcode1. After which the client could
then ask "who knows about INSPIRE1 then?", proceeding iteratively on
the client side as need be. This is not ideal as it can lead to many nested
queries.

Approach 2: resolving transitive relations server-side

Considering the fact that the sought-after relation is transitive, the
ClaimStore itself could attempt to resolve these recursions on the server side,
returning directly also the claim 01 that is joined by means of claim 02 to the
claim number 03.

The behaviour of the API could be parametrised via a new recurse option:

GET /claims?type=bibcode&value=bibcode1&recurse=true

that would be False by default, True on demand.

Optionally, the query can accept a certainty argument:

GET /claims?type=bibcode&value=bibcode1&recurse=true&certainty=0.9

which would include into recursing only those relations that have a certainty of
at least 0.9.

(see also #8)

@tiborsimko tiborsimko added the api label Sep 3, 2015
@jbenito3 jbenito3 modified the milestone: v0.3.0 Sep 7, 2015
@jbenito3 jbenito3 modified the milestones: v0.4.0, v0.3.0, v0.5.0 Sep 14, 2015
jbenito3 added a commit to jbenito3/claimstore that referenced this issue Sep 17, 2015
* Adds an extra Model that keeps track of all the equivalent IDs.
  (closes inveniosoftware#49)

* Enables transitive queries to fetch all the related claims (through
  `/claims?type=xxx&value=yyy&recurse=1`.

* Adds a new API resource `/eqids` to list all the equivalent IDs (one can also
  filter by a specific id using the argument `eqid=`).

Signed-off-by: Jose Benito Gonzalez Lopez <jose.benito.gonzalez@cern.ch>
jbenito3 added a commit to jbenito3/claimstore that referenced this issue Sep 17, 2015
* Adds an extra Model that keeps track of all the equivalent IDs.
  (closes inveniosoftware#49)

* Enables transitive queries to fetch all the related claims (through
  `/claims?type=xxx&value=yyy&recurse=1`.

* Adds a new API resource `/eqids` to list all the equivalent IDs
  (one can also filter by a specific id using the argument `eqid=`).

Signed-off-by: Jose Benito Gonzalez Lopez <jose.benito.gonzalez@cern.ch>
jbenito3 added a commit to jbenito3/claimstore that referenced this issue Sep 18, 2015
* Adds an extra Model that keeps track of all the equivalent IDs.
  (closes inveniosoftware#49)

* Enables transitive queries to fetch all the related claims (through
  `/claims?type=xxx&value=yyy&recurse=1`.

* Adds a new API resource `/eqids` to list all the equivalent IDs
  (one can also filter by a specific id using the argument `eqid=`).

Signed-off-by: Jose Benito Gonzalez Lopez <jose.benito.gonzalez@cern.ch>
jbenito3 added a commit to jbenito3/claimstore that referenced this issue Sep 18, 2015
* Adds an extra Model that keeps track of all the equivalent IDs.
  (closes inveniosoftware#49)

* Enables transitive queries to fetch all the related claims (through
  `/claims?type=xxx&value=yyy&recurse=1`.

* Adds a new API resource `/eqids` to list all the equivalent IDs
  (one can also filter by a specific id using the argument `eqid=`).

* Adds command `claimstore index` in order to do operations with
  indeces. For instance: `claimstore index clear_eqids` and
  `claimstore index rebuild_eqids`.

Signed-off-by: Jose Benito Gonzalez Lopez <jose.benito.gonzalez@cern.ch>
jbenito3 added a commit to jbenito3/claimstore that referenced this issue Sep 18, 2015
* Adds an extra Model that keeps track of all the equivalent IDs.
  (closes inveniosoftware#49)

* Enables transitive queries to fetch all the related claims (through
  `/claims?type=xxx&value=yyy&recurse=1`.

* Adds a new API resource `/eqids` to list all the equivalent IDs
  (one can also filter by a specific id using the argument `eqid=`).

* Adds command `claimstore index` in order to do operations with
  indeces. For instance: `claimstore index clear_eqids` and
  `claimstore index rebuild_eqids`.

Signed-off-by: Jose Benito Gonzalez Lopez <jose.benito.gonzalez@cern.ch>
jbenito3 added a commit to jbenito3/claimstore that referenced this issue Sep 18, 2015
* Adds an extra Model that keeps track of all the equivalent IDs.
  (closes inveniosoftware#49)

* Enables transitive queries to fetch all the related claims (through
  `/claims?type=xxx&value=yyy&recurse=1`.

* Adds a new API resource `/eqids` to list all the equivalent IDs
  (one can also filter by a specific id using the argument `eqid=`).

* Adds command `claimstore index` in order to do operations with
  indeces. For instance: `claimstore index clear_eqids` and
  `claimstore index rebuild_eqids`.

Signed-off-by: Jose Benito Gonzalez Lopez <jose.benito.gonzalez@cern.ch>
jbenito3 added a commit to jbenito3/claimstore that referenced this issue Sep 18, 2015
* Adds an extra Model that keeps track of all the equivalent IDs.
  (closes inveniosoftware#49)

* Enables transitive queries to fetch all the related claims (through
  `/claims?type=xxx&value=yyy&recurse=1`.

* Adds a new API resource `/eqids` to list all the equivalent IDs
  (one can also filter by a specific id using the argument `eqid=`).

* Adds command `claimstore index` in order to do operations with
  indeces. For instance: `claimstore index clear_eqids` and
  `claimstore index rebuild_eqids`.

Signed-off-by: Jose Benito Gonzalez Lopez <jose.benito.gonzalez@cern.ch>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants