-
Notifications
You must be signed in to change notification settings - Fork 149
Create Relationships between Resources
On a resource's Details page, there is a link to view relationships (see How to View Resource Relationships) the resource has with other resources in the geoportal catalog. The mechanism for defining relationships between resources is through the metadata for the resource itself.
The syntax for defining the relationship tree is similar to the syntax used for defining the nodes in the Browse tab's tree (see Browse Tree), but instead of defining REST filters for specific search criteria, filters for relationships are defined. This topic describes how to define those filters, and how to prepare metadata such that it includes elements that allow relationships between resources.
Although it is possible to configure a REST search request for each relationship node, the resource relationship mechanism is primarily designed for searching resources having a given property matching a specific property of the selected resource. This differs from the Browse tab's query syntax, in that the searchText REST query is not used, but instead a query for the specific relationship.
The browsing structure to view resource relationships is defined in the \\geoportal\WEB-INF\classes\gpt\search\browse\browse-resource.xml file. Open this file, and you will see the definitions for the nodes that appear in the Relationship page's Resource tree. Each node has a <query></query> tag associated with it, and it is in this <query></query> tag that the search for a relationship is defined. The query within the <query></query> tag consists of three parts:
- urn:esri:geoportal:browse:resourceRelationship: means that the query will depend on both a property of the selected resource and a property of related resources.
- <property-meaning></property-meaning> indicates the property-meaning of the selected resource used to set the search matching value.
- <property-meaning></property-meaning> indicates the property-meaning against which the related resources must match the search value.
For example, the second <query></query> tag in the default browse-resource.xml file defines the usedBy relationship, which is usually used with services that operate on specified datasets. Within it the <query></query> tag, you will see the following string:
urn:esri:geoportal:browse:resourceRelationship:apiso.ResourceIdentifier-apiso.OperatesOn
The query expresses a search seeking for resources having the apiso.OperatesOn property matching the apiso.ResourceIdentifier property value of the selected resource.
For example, consider the following two INSPIRE metadata snippets, Example A and Example B. Example A has its apiso.ResourceIdentifier property set to {FC784D97-30F7-4AB0-A9EA-A690D43E1295}. Example B has its apiso.OperatesOn property set to the same value. Under these circumstances, the resources related with Example A according to a "usedBy" relationship would include Example B:
Example A | Example B |
<identifier> <MD_Identifier> <gco:CharacterString> {FC784D97-30F7-4AB0-A9EA-A690D43E1295} </gco:characterstring> </md_identifier> </identifier> | <srv:operatesOn xmlns:xlink =" http://www.w3.org/1999/xlink" uuidref =" {FC784D97-30F7-4AB0-A9EA-A690D43E1295}"/> |