<!-- Please fill out this issue to the best of your knowledge, this will help the governance and release process move forward.-->
# Change proposal description
<!-- Provide a brief description of the change proposal. -->
Add a link from ProductionSite to ProductionFacility as mentioned in the UML model (using the element *hostedFacility*)
## Issue faced
<!-- Provide a description of the issue, outlining expected schema behaviour, current behaviour and, when deemed necessary, the steps to reproduce the issues under the headings below. -->
* Linking one or more ProductionFacilities to a given ProductionSite is not possible.
* The link from ProductionSite to ProductionFacility is not voidable.
* minOccur of the element *hostedFacility* is 1
### Expected behaviour
There is a link from ProductionSite to ProductionFacility as described in the UML model through the element *hostedFacility*. With this one could link one or multiple ProductionFacilities to a single ProductionSite.
### Current behaviour
Only the link from ProductionFacility to ProductionSite is implemented (through the element *hostingSite* in the feature type ProductionFacility). This link is voidable. The non-voidable backwards-link is missing.
### Steps to reproduce
Try to link one or multiple ProductionFacilities to a single ProductionSite using the element *hostedFacility* as mentioned in the UML model.
## Proposed solution
<!-- Detail the proposed changes (spatial objects addressed, updates/additions proposed, etc.). -->
Implementing above mentioned link into the xml schema PF as described below.
### Technical details
<!-- If possible, complement this change proposal with a pull request where the exact changes are shown and add here the link to the pull request. Alternatively, provide technical details of the proposed change (e.g. XML snippets, UML diagrams, etc.). -->
Adding following XML snippet to the feature type ProductionSite should implement the expected behaviour (changed from the link from ProductionFacility to ProductionSite):
```
<element minOccurs="1" maxOccurs="unbounded" name="hostedFacility" nillable="false">
<annotation>
<documentation>A Facility may be located on one Site</documentation>
</annotation>
<complexType>
<sequence minOccurs="1">
<element ref="pf:ProductionFacility"/>
</sequence>
<attributeGroup ref="gml:AssociationAttributeGroup"/>
<attributeGroup ref="gml:OwnershipAttributeGroup"/>
</complexType>
</element>
```
# Additional information
## Proposal reason
<!-- Specify whether this change proposal is needed because of a bug or because the current schema version does not fit specific use cases. In the latter case, explain which are those use cases. -->
The UML model mentions a non-voidable link from ProductionSite to ProductionFacility through the element *hostedFacility* with a minOccur of 1. Not possible use case: Linking one or multiple ProductionFacilities to a given ProductionSite.
## Addressed schema
<!-- Specify the INSPIRE schema addressed. -->
https://[inspire.ec.europa.eu/schemas/pf/4.0/ProductionAndIndustrialFacilities.xsd](https://inspire.ec.europa.eu/schemas/pf/4.0/ProductionAndIndustrialFacilities.xsd)
Dear @schwichtenbergAtLUNG,
thank you for submitting the change proposal.
We checked your proposal and verified that the association "hostedFacility" is not defined by the Implementing Rule ([Commission Regulation (EU) No 1089/2010 of 23 November 2010 implementing Directive 2007/2/EC of the European Parliament and of the Council as regards interoperability of spatial data sets and services and subsequent amendments](https://eur-lex.europa.eu/legal-content/EN/TXT/?uri=CELEX%3A02010R1089-20231119&qid=1703756768058)), see section "_8.2.4. Production Site_".
In the UML, the association has only one direction, i.e. from ProductionFacility to ProductionSite. This is why the element `hostedFacility` is not available in the XSD for the ProductionSite feature type.

At this point, it is unclear why the role name "_hostedFacility_" and multiplicity "_1..*_" were added in the UML.
In addition, it appears that there has been a mix-up of role descriptions, as they seem to have been swapped.

We will discuss this change proposal in the next Sub-group meeting.
Sub-group meeting on 06.05.2024:
the Sub-group discussed the change proposal and decided not to accept it.
Subgroup members will add more details about the reasons for rejection as comments on this issue.
The link between ProductionFacility and ProductionSite is [navigable](https://www.uml-diagrams.org/association.html#navigability) in the direction towards ProductionSite. Consequently, all production facilities that are hosted on a given production site can be found in a Production and industrial facilities data set. Not by means of the hostedFacility association end, as that assocation is non-navigable, but by searching for all production facilities that have the production site as their hosting site.
For example, given the following GML data set, e.g. in file gf.gml:
```xml
<gml:FeatureCollection
xmlns:act-core="http://inspire.ec.europa.eu/schemas/act-core/4.0"
xmlns:base="http://inspire.ec.europa.eu/schemas/base/3.3"
xmlns:gml="http://www.opengis.net/gml/3.2"
xmlns:pf="http://inspire.ec.europa.eu/schemas/pf/4.0"
xmlns:xlink="http://www.w3.org/1999/xlink"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<gml:featureMember>
<pf:ProductionFacility gml:id="pf1">
<act-core:inspireId>
<base:Identifier>
<base:localId>8c89418a-3f20-403c-b7a3-12c6c6cfec38</base:localId>
<base:namespace>http://example.org</base:namespace>
</base:Identifier>
</act-core:inspireId>
<act-core:geometry>
<!-- coordinates -->
</act-core:geometry>
<act-core:function>
<act-core:Function>
<act-core:activity xlink:href="http://link.to.function" />
</act-core:Function>
</act-core:function>
<act-core:validFrom xsi:nil="true" />
<act-core:beginLifespanVersion xsi:nil="true" />
<pf:status xsi:nil="true" />
<pf:hostingSite xlink:href="#ps1" /><!-- link to the ProductionFacility with gml:id="ps1" -->
</pf:ProductionFacility>
</gml:featureMember>
<gml:featureMember>
<pf:ProductionFacility gml:id="pf2">
<act-core:inspireId>
<base:Identifier>
<base:localId>36584ad7-89d0-4b64-a137-3184decade4b</base:localId>
<base:namespace>http://example.org</base:namespace>
</base:Identifier>
</act-core:inspireId>
<act-core:geometry>
<!-- coordinates -->
</act-core:geometry>
<act-core:function>
<act-core:Function>
<act-core:activity xlink:href="http://link.to.function" />
</act-core:Function>
</act-core:function>
<act-core:validFrom xsi:nil="true" />
<act-core:beginLifespanVersion xsi:nil="true" />
<pf:status xsi:nil="true" />
<pf:hostingSite xlink:href="#ps1" /><!-- link to the ProductionFacility with gml:id="ps1" -->
</pf:ProductionFacility>
</gml:featureMember>
<gml:featureMember>
<pf:ProductionFacility gml:id="pf3">
<act-core:inspireId>
<base:Identifier>
<base:localId>16f3974b-1e95-43fd-bf8c-0272151ae6b2</base:localId>
<base:namespace>http://example.org</base:namespace>
</base:Identifier>
</act-core:inspireId>
<act-core:geometry>
<!-- coordinates -->
</act-core:geometry>
<act-core:function>
<act-core:Function>
<act-core:activity xlink:href="http://link.to.function" />
</act-core:Function>
</act-core:function>
<act-core:validFrom xsi:nil="true" />
<act-core:beginLifespanVersion xsi:nil="true" />
<pf:status xsi:nil="true" />
<pf:hostingSite xlink:href="#ps2" /><!-- link to the ProductionFacility with gml:id="ps2" -->
</pf:ProductionFacility>
</gml:featureMember>
<gml:featureMember>
<pf:ProductionSite gml:id="ps1">
<pf:inspireId>
<base:Identifier>
<base:localId>07139631-2adb-4dae-93ed-32ac2692fec4</base:localId>
<base:namespace>http://example.org</base:namespace>
</base:Identifier>
</pf:inspireId>
<pf:geometry>
<!-- coordinates -->
</pf:geometry>
<pf:status xsi:nil="true" />
</pf:ProductionSite>
</gml:featureMember>
<gml:featureMember>
<pf:ProductionSite gml:id="ps2">
<pf:inspireId>
<base:Identifier>
<base:localId>c4988f9d-77b1-4fd8-8f6d-437f97ec221f</base:localId>
<base:namespace>http://example.org</base:namespace>
</base:Identifier>
</pf:inspireId>
<pf:geometry>
<!-- coordinates -->
</pf:geometry>
<pf:status xsi:nil="true" />
</pf:ProductionSite>
</gml:featureMember>
</gml:FeatureCollection>
```
XPath expression `/gml:FeatureCollection/gml:featureMember/pf:ProductionFacility[pf:hostingSite/@xlink:href='#ps1']` will then give all production facilities that have production site with gml id ps1 as their hosting site, thus the production facilities with gml id pf1 and pf2.

Note the following from [INSPIRE Generic Conceptual Model](http://inspire.ec.europa.eu/documents/inspire-generic-conceptual-model):

In other words, the modelling of the hostedFacility association end as a non-navigable association was probably an intentional decision of the authors of the Production and industrial facilities data specification.
As for the multiplicity: it is ok to have a multiplicity and role name specified for non-navigable association ends in the UML models, they just won't turn up in the resulting GML application schemas.
One could argue that the multiplicity for hostedFacility should be changed from 1..* to 0..*, as the current model assumes that a production site hosts at least one production facility, and that is possibly not always be the case. Such change could be done in the UML model without affecting the application schema or the IR, if wished. In that case, it should be changed via https://github.com/INSPIRE-MIF/uml-models.
Thank you, @heidivanparys , for the detailed explanation. I think it would be better to remove the association, though, as @JohannaOtt mentioned in #126 to avoid further confusion and issue openings.
Sub-group meeting on 11.11.2024:
The sub-group reviewed the suggestion to remove the association roles from the UML and decided to retain the roles in the association properties while hiding them in the diagram.
This solution will maintain clear documentation of roles associated with different feature types, helping to avoid confusion caused by their visibility in the UML diagram.
These updates will be implemented in the upcoming release scheduled for the end of January 2025.
