Ticket #699 (closed Enhancement: fixed)

Opened 10 years ago

Last modified 10 years ago

Core API: remove "fetchComposite" parameter

Reported by: jri Owned by: jri
Priority: Major Milestone: Release 4.4
Component: DeepaMehta Standard Distribution Version: 4.3
Keywords: Cc: dgf, Malte, carolina
Complexity: 5 Area: Application Framework / API
Module: deepamehta-core

Description

The fetchComposite parameter is omnipresent in the Core (and other) APIs and make them cumbersome to use/remember.

The fetchComposite parameter should be dropped. Instead topics/associations should be always retrieved *without* their "composite value" (= child topics). The child topics should be retrieved selectively and on-demand, that is once accessed, e.g. via comp.getTopic().

The only spot where the fetchComposite parameter should appear is the REST APIs. This is because selective on-demand loading is not efficient via the network.

See also #411

Change History

comment:1 Changed 10 years ago by jri

  • Status changed from new to accepted

comment:2 Changed 10 years ago by Jörg Richter

APIs: remove "fetchComposite" paramter (#699).

BREAKING CHANGE

The "fetchComposite" paramter is removed from Core and other APIs.

Not yet functional.

See #699.

comment:3 follow-up: ↓ 36 Changed 10 years ago by Jörg Richter

Load child topics in response filter (#699).

BREAKING CHANGE

Core REST API: if the fetch_composite query parameter is not present in the request false is assumed. That is, by deafult the response entity contains no child topics. If child topics are wanted fetch_composite=true must be stated explicitely.
(In DM 4.3 and before fetch_composite=true was the default for single item responses and fetch_composite=false was the default for item collections responses. These differentiation is no abolished in favor of better remembrance.)

All REST APIs: if the request has a fetch_composite=true query parameter the child topics of the response entity are loaded automatically. For standard cases the plugin developer must not care about child topic loading. Child topic loading is performed generically by the Core's JerseyResponseFilter.

Automatic child topic loading works for responses of these types:

  • Topic
  • Association
  • Iterable<Topic>

If the response is not of one of these types the plugin developer must care about manual child topic loading. She does so by using DeepaMehtaObject's loadChildTopics() methods.

See #699.

comment:4 Changed 10 years ago by Jörg Richter

Core API: loadChildTopics() returns object (#699).

The loadChildTopics() methods return the object itself, thus allowing call chaining (formerly void).

DeepaMehtaObject
    DeepaMehtaObject loadChildTopics();
    DeepaMehtaObject loadChildTopics(String childTypeUri);

Topic
    Topic loadChildTopics();
    Topic loadChildTopics(String childTypeUri);

Association
    Association loadChildTopics();
    Association loadChildTopics(String childTypeUri);

See #699.

comment:5 Changed 10 years ago by Jörg Richter

Webclient: adapt to Core changes (#699).

Fix: detail panel shows object along with its child topics.

See #699.

comment:6 Changed 10 years ago by Jörg Richter

Type loading: adapt to Core changes pt.2 (#699).

Core fix: view configs are loaded properly.

Core API:

ResultList? has a new method

ResultList<T> loadChildTopics()

It loads the child topics of all the objects contained in the result list.

See #699.

comment:7 Changed 10 years ago by Jörg Richter

Label building: adapt to Core changes pt.3 (#699).

Topicmaps fix: topicmaps keep their name once translated.

See #699.

comment:8 Changed 10 years ago by Jörg Richter

Webclient: adapt to Core changes pt.4 (#699).

Fix: when navigating via "what's related" the revealed topic is displayed along with its childs.

See #699.

comment:9 Changed 10 years ago by Jörg Richter

Geomaps: adapt to Core changes pt.4 (#699).

Geomaps are functional again.

BREAKING CHANGE

Geomaps API:

The topic returned by the getDomainTopic() service call does *not* include its child topics.
When you need the child topics:

  • Java API:
    • on-demand loading (selectively): just call the accessors of the topic's composite value, e.g. topic.getCompositeValue().getString(...). The respective child topics are loaded on-demand.
    • explicit loading:
      • topic.loadChildTopics() loads all child topics
      • topic.loadChildTopics(childTypeUri) loads child topics selectively
  • REST API: add fetch_composite=true to the query parameters. All child topics are included in the response.

See #699.

comment:10 Changed 10 years ago by Jörg Richter

Facets module: adapt to Core changes pt.6 (#699).

Core's DeepaMehtaUtils:

toTopicModels() takes an Iterable instead of a List. This allows e.g. to pass a ResultList directly (instead of calling getItems() on it before).

BREAKING CHANGES

Facets API:

  1. The topics returned by the getFacet() and getFacets() service calls do *not* include their child topics.

When you need the child topics:

  • Java API:
    • on-demand loading (selectively): just call the accessors of the topic's composite value, e.g. topic.getCompositeValue().getString(...). The respective child topics are loaded on-demand.
    • explicit loading:
      • topic.loadChildTopics() loads all child topics
      • topic.loadChildTopics(childTypeUri) loads child topics selectively
  • REST API: add fetch_composite=true to the query parameters. All child topics will be included in the response then.
  1. The topic returned by the getFacettedTopic() service call does *not* include its child topics.

When you need the child topics: see 1.

  1. The getFacets() service calls return a ResultList (formerly List). This allows to call loadChildTopics() on it (see 1.) to load all child topics of all items contained in the result list.

See #699.

comment:11 Changed 10 years ago by Jörg Richter

comment:12 Changed 10 years ago by Jörg Richter

Topicmaps: adapt to Core changes pt.8 (#699).

Retrieving a topicmap including the topic's child child topics works again.
Needed for the Import Export plugin.

The "remove fetchComposite parameter" related work should be complete now. Ready for merging into master.

2 things remain to investigate (see "FIXME: had fetchComposite=true"):

  • Files API.
  • Create/Update? requests containing topic references (see #614). In conjunction with Malte's Wikidata plugin.

See #699.

comment:13 Changed 10 years ago by Jörg Richter

APIs: remove "fetchComposite" paramter (#699).

BREAKING CHANGE

The "fetchComposite" paramter is removed from Core and other APIs.

Not yet functional.

See #699.

comment:14 Changed 10 years ago by Jörg Richter

Load child topics in response filter (#699).

BREAKING CHANGE

Core REST API: if the fetch_composite query parameter is not present in the request false is assumed. That is, by deafult the response entity contains no child topics. If child topics are wanted fetch_composite=true must be stated explicitely.
(In DM 4.3 and before fetch_composite=true was the default for single item responses and fetch_composite=false was the default for item collections responses. These differentiation is no abolished in favor of better remembrance.)

All REST APIs: if the request has a fetch_composite=true query parameter the child topics of the response entity are loaded automatically. For standard cases the plugin developer must not care about child topic loading. Child topic loading is performed generically by the Core's JerseyResponseFilter.

Automatic child topic loading works for responses of these types:

  • Topic
  • Association
  • Iterable<Topic>

If the response is not of one of these types the plugin developer must care about manual child topic loading. She does so by using DeepaMehtaObject's loadChildTopics() methods.

See #699.

comment:15 Changed 10 years ago by Jörg Richter

Core API: loadChildTopics() returns object (#699).

The loadChildTopics() methods return the object itself, thus allowing call chaining (formerly void).

DeepaMehtaObject
    DeepaMehtaObject loadChildTopics();
    DeepaMehtaObject loadChildTopics(String childTypeUri);

Topic
    Topic loadChildTopics();
    Topic loadChildTopics(String childTypeUri);

Association
    Association loadChildTopics();
    Association loadChildTopics(String childTypeUri);

See #699.

comment:16 Changed 10 years ago by Jörg Richter

Webclient: adapt to Core changes (#699).

Fix: detail panel shows object along with its child topics.

See #699.

comment:17 Changed 10 years ago by Jörg Richter

Type loading: adapt to Core changes pt.2 (#699).

Core fix: view configs are loaded properly.

Core API:

ResultList? has a new method

ResultList<T> loadChildTopics()

It loads the child topics of all the objects contained in the result list.

See #699.

comment:18 Changed 10 years ago by Jörg Richter

Label building: adapt to Core changes pt.3 (#699).

Topicmaps fix: topicmaps keep their name once translated.

See #699.

comment:19 Changed 10 years ago by Jörg Richter

Webclient: adapt to Core changes pt.4 (#699).

Fix: when navigating via "what's related" the revealed topic is displayed along with its childs.

See #699.

comment:20 Changed 10 years ago by Jörg Richter

Geomaps: adapt to Core changes pt.4 (#699).

Geomaps are functional again.

BREAKING CHANGE

Geomaps API:

The topic returned by the getDomainTopic() service call does *not* include its child topics.
When you need the child topics:

  • Java API:
    • on-demand loading (selectively): just call the accessors of the topic's composite value, e.g. topic.getCompositeValue().getString(...). The respective child topics are loaded on-demand.
    • explicit loading:
      • topic.loadChildTopics() loads all child topics
      • topic.loadChildTopics(childTypeUri) loads child topics selectively
  • REST API: add fetch_composite=true to the query parameters. All child topics are included in the response.

See #699.

comment:21 Changed 10 years ago by Jörg Richter

Facets module: adapt to Core changes pt.6 (#699).

Core's DeepaMehtaUtils:

toTopicModels() takes an Iterable instead of a List. This allows e.g. to pass a ResultList directly (instead of calling getItems() on it before).

BREAKING CHANGES

Facets API:

  1. The topics returned by the getFacet() and getFacets() service calls do *not* include their child topics.

When you need the child topics:

  • Java API:
    • on-demand loading (selectively): just call the accessors of the topic's composite value, e.g. topic.getCompositeValue().getString(...). The respective child topics are loaded on-demand.
    • explicit loading:
      • topic.loadChildTopics() loads all child topics
      • topic.loadChildTopics(childTypeUri) loads child topics selectively
  • REST API: add fetch_composite=true to the query parameters. All child topics will be included in the response then.
  1. The topic returned by the getFacettedTopic() service call does *not* include its child topics.

When you need the child topics: see 1.

  1. The getFacets() service calls return a ResultList (formerly List). This allows to call loadChildTopics() on it (see 1.) to load all child topics of all items contained in the result list.

See #699.

comment:22 Changed 10 years ago by Jörg Richter

comment:23 Changed 10 years ago by Jörg Richter

Topicmaps: adapt to Core changes pt.8 (#699).

Retrieving a topicmap including the topic's child child topics works again.
Needed for the Import Export plugin.

The "remove fetchComposite parameter" related work should be complete now. Ready for merging into master.

2 things remain to investigate (see "FIXME: had fetchComposite=true"):

  • Files API.
  • Create/Update? requests containing topic references (see #614). In conjunction with Malte's Wikidata plugin.

See #699.

comment:24 Changed 10 years ago by Jörg Richter

APIs: remove "fetchComposite" paramter (#699).

BREAKING CHANGE

The "fetchComposite" paramter is removed from Core and other APIs.

Not yet functional.

See #699.

comment:25 Changed 10 years ago by Jörg Richter

Load child topics in response filter (#699).

BREAKING CHANGE

Core REST API: if the fetch_composite query parameter is not present in the request false is assumed. That is, by deafult the response entity contains no child topics. If child topics are wanted fetch_composite=true must be stated explicitely.
(In DM 4.3 and before fetch_composite=true was the default for single item responses and fetch_composite=false was the default for item collections responses. These differentiation is no abolished in favor of better remembrance.)

All REST APIs: if the request has a fetch_composite=true query parameter the child topics of the response entity are loaded automatically. For standard cases the plugin developer must not care about child topic loading. Child topic loading is performed generically by the Core's JerseyResponseFilter.

Automatic child topic loading works for responses of these types:

  • Topic
  • Association
  • Iterable<Topic>

If the response is not of one of these types the plugin developer must care about manual child topic loading. She does so by using DeepaMehtaObject's loadChildTopics() methods.

See #699.

comment:26 Changed 10 years ago by Jörg Richter

Core API: loadChildTopics() returns object (#699).

The loadChildTopics() methods return the object itself, thus allowing call chaining (formerly void).

DeepaMehtaObject
    DeepaMehtaObject loadChildTopics();
    DeepaMehtaObject loadChildTopics(String childTypeUri);

Topic
    Topic loadChildTopics();
    Topic loadChildTopics(String childTypeUri);

Association
    Association loadChildTopics();
    Association loadChildTopics(String childTypeUri);

See #699.

comment:27 Changed 10 years ago by Jörg Richter

Webclient: adapt to Core changes (#699).

Fix: detail panel shows object along with its child topics.

See #699.

comment:28 Changed 10 years ago by Jörg Richter

Type loading: adapt to Core changes pt.2 (#699).

Core fix: view configs are loaded properly.

Core API:

ResultList? has a new method

ResultList<T> loadChildTopics()

It loads the child topics of all the objects contained in the result list.

See #699.

comment:29 Changed 10 years ago by Jörg Richter

Label building: adapt to Core changes pt.3 (#699).

Topicmaps fix: topicmaps keep their name once translated.

See #699.

comment:30 Changed 10 years ago by Jörg Richter

Webclient: adapt to Core changes pt.4 (#699).

Fix: when navigating via "what's related" the revealed topic is displayed along with its childs.

See #699.

comment:31 Changed 10 years ago by Jörg Richter

Geomaps: adapt to Core changes pt.4 (#699).

Geomaps are functional again.

BREAKING CHANGE

Geomaps API:

The topic returned by the getDomainTopic() service call does *not* include its child topics.
When you need the child topics:

  • Java API:
    • on-demand loading (selectively): just call the accessors of the topic's composite value, e.g. topic.getCompositeValue().getString(...). The respective child topics are loaded on-demand.
    • explicit loading:
      • topic.loadChildTopics() loads all child topics
      • topic.loadChildTopics(childTypeUri) loads child topics selectively
  • REST API: add fetch_composite=true to the query parameters. All child topics are included in the response.

See #699.

comment:32 Changed 10 years ago by Jörg Richter

Facets module: adapt to Core changes pt.6 (#699).

Core's DeepaMehtaUtils:

toTopicModels() takes an Iterable instead of a List. This allows e.g. to pass a ResultList directly (instead of calling getItems() on it before).

BREAKING CHANGES

Facets API:

  1. The topics returned by the getFacet() and getFacets() service calls do *not* include their child topics.

When you need the child topics:

  • Java API:
    • on-demand loading (selectively): just call the accessors of the topic's composite value, e.g. topic.getCompositeValue().getString(...). The respective child topics are loaded on-demand.
    • explicit loading:
      • topic.loadChildTopics() loads all child topics
      • topic.loadChildTopics(childTypeUri) loads child topics selectively
  • REST API: add fetch_composite=true to the query parameters. All child topics will be included in the response then.
  1. The topic returned by the getFacettedTopic() service call does *not* include its child topics.

When you need the child topics: see 1.

  1. The getFacets() service calls return a ResultList (formerly List). This allows to call loadChildTopics() on it (see 1.) to load all child topics of all items contained in the result list.

See #699.

comment:33 Changed 10 years ago by Jörg Richter

comment:34 Changed 10 years ago by Jörg Richter

Topicmaps: adapt to Core changes pt.8 (#699).

Retrieving a topicmap including the topic's child child topics works again.
Needed for the Import Export plugin.

The "remove fetchComposite parameter" related work should be complete now. Ready for merging into master.

2 things remain to investigate (see "FIXME: had fetchComposite=true"):

  • Files API.
  • Create/Update? requests containing topic references (see #614). In conjunction with Malte's Wikidata plugin.

See #699.

comment:35 Changed 10 years ago by jri

  • Status changed from accepted to closed
  • Resolution set to fixed

comment:36 in reply to: ↑ 3 Changed 10 years ago by jri

  • Status changed from closed to reopened
  • Resolution fixed deleted

Replying to Jörg Richter:

All REST APIs: if the request has a fetch_composite=true query parameter the child topics of the response entity are loaded automatically. For standard cases the plugin developer must not care about child topic loading. Child topic loading is performed generically by the Core's JerseyResponseFilter.

Automatic child topic loading works for responses of these types:

  • Topic
  • Association
  • Iterable<Topic>

Obviously Iterable<Association> is missing here.
This should be added.

If the response is not of one of these types the plugin developer must care about manual child topic loading. She does so by using DeepaMehtaObject's loadChildTopics() methods.

comment:37 follow-up: ↓ 38 Changed 10 years ago by Jörg Richter

Core: include_childs for association lists (#699).

All REST APIs: the Core's JerseyResponseFilter processes the fetch_composite query parameter also for Iterable<Association> responses.

In particular this works for the GET /core/topic/{id}/related_assocs request (see #672, see #707).

See #699.

comment:38 in reply to: ↑ 37 Changed 10 years ago by jri

Replying to Jörg Richter:

All REST APIs: the Core's JerseyResponseFilter processes the fetch_composite query parameter also for Iterable<Association> responses.

CORRECTION: meanwhile the fetch_composite query parameter is named include_childs, see #702.

comment:39 Changed 10 years ago by Jörg Richter

Core: include_childs for association lists (#699).

All REST APIs: the Core's JerseyResponseFilter processes the fetch_composite query parameter also for Iterable<Association> responses.

In particular this works for the GET /core/topic/{id}/related_assocs request (see #672, see #707).

See #699.

comment:40 Changed 10 years ago by jri

  • Status changed from reopened to closed
  • Resolution set to fixed

comment:41 Changed 10 years ago by Malte

Just for the record:
Since fetchRelatingComposite vanished too having support for an include_assoc_childs parameter when returning RelatedTopic?(s) and RelatedAssociation?(s) over the REST API would be nice.

Note: See TracTickets for help on using tickets.