Project

General

Profile

Question #1270

Feature #1206: API: Show entities of subtypes

Administrative Unit and Historical Place get not covered with links or relationship

Added by Bernhard Koschiček-Krombholz over 1 year ago. Updated about 1 year ago.

Status:
Closed
Priority:
Low
Category:
API
Target version:
-
Start date:
2020-06-07
Estimated time:

Description

The API doesn't provide information about the administrative unit or the historical place. Normally it should be in the under relations, but apparently it is not covered by Link.get_links(). This bug is also linked to the Feature #1206.

History

#1

Updated by Bernhard Koschiček-Krombholz over 1 year ago

  • Parent task set to #1206
#2

Updated by Alexander Watzinger over 1 year ago

  • Found in version deleted (API)
  • Tracker changed from Bug to Question

Without having looked at the code I assume that's because administrative units and historical places are linked to the place, not the object. So you would have to get the place (E53) linked to the object (E18) with "has location" (P53) and than get them via "falls within" (P89).

e.g. at place_update() in views/place.py the location "brings" its own types/nodes (including admin. units and historical places):

    object_ = Entity.get_by_id(id_, nodes=True, aliases=True, view_name='place')
    location = object_.get_linked_entity_safe('P53', nodes=True)

This is just the technical answer but raises the questions how we want to deal with it in the API. In the user interface object and place are presented as one and I guess it would make sense to do the same in the API since it's a 1:1 relation. So one way to stay CIDOC CRM conform would be to present a "sub entity" E53 with all the links when requesting the object (E18). Be aware that there can be multiple links, e.g. a region spans multiple historical places.

Feel free to ask, meet or discuss at next API meeting if you need more information.

#3

Updated by Alexander Watzinger about 1 year ago

  • Target version set to API
#4

Updated by Alexander Watzinger about 1 year ago

Didn't we solve this in the last session? Can this be closed?

#5

Updated by Bernhard Koschiček-Krombholz about 1 year ago

Yes and no. It works, but it has bugs that I need to clean up before we can close this.

#6

Updated by Alexander Watzinger about 1 year ago

Got it. Thanks for feedback.

#7

Updated by Bernhard Koschiček-Krombholz about 1 year ago

  • Status changed from Assigned to Closed

Ok I tested it today and it seems to work fine. Sry for the misinformation.

#8

Updated by Bernhard Koschiček-Krombholz about 1 year ago

  • Assignee changed from Bernhard Koschiček-Krombholz to Alexander Watzinger
#9

Updated by Alexander Watzinger about 1 year ago

  • Target version deleted (API)

Cleared target version so that it doesn't show up in roadmap anymore

Also available in: Atom PDF