Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Standard / DCAT (and profiles) export #7600

Open
wants to merge 89 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
89 commits
Select commit Hold shift + click to select a range
262422f
Standard / ISO / DCAT formatters
fxprunayre Oct 3, 2023
b1555e9
Formatter / DCAT / Improvements.
fxprunayre Dec 6, 2023
0d06674
Formatter / DCAT / Core.
fxprunayre Dec 7, 2023
94318cb
Formatter / DCAT / Core / Associated.
fxprunayre Dec 7, 2023
10ee379
Formatter / DCAT / Core / Lineage.
fxprunayre Dec 7, 2023
1944cd4
Formatter / DCAT / Core / Dataset / Temporal.
fxprunayre Dec 8, 2023
18fb48c
Formatter / DCAT / Core / Dataset / Distributions.
fxprunayre Dec 11, 2023
18285eb
Formatter / DCAT / Core / Dataset / Services.
fxprunayre Dec 11, 2023
87fcbf2
Formatter / DCAT / Core / Mulitlingual support.
fxprunayre Dec 11, 2023
19b11e5
Formatter / DCAT / RDF valid model.
fxprunayre Dec 11, 2023
b59f45d
Formatter / DCAT / Tests.
fxprunayre Dec 11, 2023
354ba25
Formatter / EU-DCAT-AP / CatalogRecord.
fxprunayre Dec 12, 2023
2ff0c73
Formatter / DCAT / Test dep.
fxprunayre Dec 12, 2023
cb6e152
Formatter / EU-DCAT-AP / Draft with test.
fxprunayre Dec 12, 2023
ebb1104
Added DCAT-AP validation with SHACL rules in FormatterApiTest.
GeryNi Dec 14, 2023
26297e2
Library / Update Jena for SHACL validation (issue on various commons-…
fxprunayre Dec 14, 2023
0871113
Formatter / EU-DCAT-AP / Improve shacl validation status - license an…
fxprunayre Dec 14, 2023
eccaf59
Formatter / EU-DCAT-AP / Improve shacl validation status - bytesize.
fxprunayre Dec 14, 2023
0fbd299
Formatter / EU-DCAT-AP / Improve shacl validation status - 1 format, …
fxprunayre Dec 14, 2023
374682b
Formatter / EU-DCAT-AP / Improve shacl validation status - license, a…
fxprunayre Dec 14, 2023
f0bf45e
Formatter / EU-DCAT-AP / Improve shacl validation status - dcat:theme…
fxprunayre Dec 15, 2023
b85e1e5
Formatter / EU-DCAT-AP / Improve shacl validation status - primaryTop…
fxprunayre Dec 15, 2023
d8b4c7a
Formatter / EU-DCAT-AP / Improve shacl validation status - only one d…
fxprunayre Dec 15, 2023
e3d2780
Formatter / EU-DCAT-AP / Add 2.1.1 base shacl validation level.
fxprunayre Dec 15, 2023
9aae81d
Formatter / EU-DCAT-AP / Validation / Shacl 2.1.1 / Success.
fxprunayre Dec 15, 2023
92638f0
Formatter / EU-DCAT-AP-HVD / Base conversion with HVD category
fxprunayre Jan 2, 2024
bfa921c
Formatter / EU-DCAT-AP-HVD / Add Shacl validation - which is failing …
fxprunayre Jan 3, 2024
e914ce0
Formatter / EU-GEODCAT-AP / CatalogRecord.
fxprunayre Jan 3, 2024
191b5d2
Formatter / EU-GEODCAT-AP / Shacl validation.
fxprunayre Jan 3, 2024
52e7b15
Formatter / DCAT / Declare ISO conformity for the source and DCAT-AP …
fxprunayre Jan 4, 2024
d1d58bf
Formatter / DCAT / ISO19139 bridges.
fxprunayre Jan 4, 2024
21a802f
Added Mobility DCAT - Mobility Theme concept.
GeryNi Jan 29, 2024
c269f34
CSW / Improve outputschema configuration and add DCAT outputs.
fxprunayre Jan 29, 2024
8a2117f
CSW / Improve outputschema configuration / Add config for ISO19110 an…
fxprunayre Jan 30, 2024
41e1132
DCAT / Mobility / Remove unused import.
fxprunayre Jan 30, 2024
fcbbf93
Added Mobility DCAT - support of georefenrecingMethod, networkCoverag…
GeryNi Feb 8, 2024
08c9f90
WIP mobility dcat - distribution
GeryNi Mar 8, 2024
6678540
Dependencies / Declare version in root pom.
fxprunayre Mar 18, 2024
3db7cd5
DCAT / ISO19139 / Fallback URI builder when no metadata linkage exist…
fxprunayre Mar 18, 2024
842eea7
Merge remote-tracking branch 'origin/main' into dcat
fxprunayre Mar 18, 2024
094e161
DCAT / Add formatters to test list.
fxprunayre Mar 18, 2024
7c7d7f7
Merge remote-tracking branch 'origin/main' into dcat
fxprunayre Apr 4, 2024
37fad57
Standard / ISO / DCAT formatters / GeoDCAT-AP / Use dct:description i…
fxprunayre Apr 4, 2024
347f93b
Standard / ISO / DCAT formatters / EU-DCAT-AP / Update shacl validati…
fxprunayre Apr 4, 2024
cbb4846
Standard / ISO / DCAT formatters / Testing / Turn off shacl phase for…
fxprunayre Apr 4, 2024
98fd57c
Standard / ISO / DCAT formatters / EU-DCAT-AP / Use dct:provenance fo…
fxprunayre Apr 4, 2024
3dd4bf2
Standard / ISO / DCAT formatters / Distributions / Do not repeat elee…
fxprunayre Apr 4, 2024
822d04a
Standard / ISO / DCAT formatters / GeoDCAT-AP spatial representation …
fxprunayre Apr 4, 2024
17c986d
Standard / ISO / DCAT formatters / GeoDCAT-AP spatialResolutionAsText…
fxprunayre Apr 4, 2024
d24b278
Standard / ISO / DCAT formatters / adms:identifier / Schema Agency on…
fxprunayre Apr 4, 2024
a0e268f
Standard / ISO / DCAT formatters / Bytesize / Range changed to xsd:no…
fxprunayre Apr 4, 2024
2fee020
Standard / ISO / DCAT formatters / GeoDCAT-AP element without mapping.
fxprunayre Apr 4, 2024
6bf9b39
Standard / ISO / DCAT formatters / HVD / Add applicable legislation.
fxprunayre Apr 4, 2024
ca31608
Standard / ISO / DCAT formatters / Assume individual name is not mult…
fxprunayre Apr 5, 2024
263de1d
Standard / ISO / DCAT formatters / Add references for org and individ…
fxprunayre Apr 8, 2024
8b3e348
Standard / ISO / DCAT formatters / Cleanup. Remove validation mode wh…
fxprunayre Apr 10, 2024
7e4ecc9
Standard / ISO / DCAT formatters / Refactor for easier object referen…
fxprunayre Apr 10, 2024
a5623a3
API / Formatter / If no output parameter is provided try to infer con…
fxprunayre Apr 11, 2024
40aeb69
Standard / ISO / DCAT formatters / A bit closer to what EU-DCAT-AP SH…
fxprunayre Apr 11, 2024
4a2df82
Standard / ISO / DCAT formatters / Shacl rules are now in the same fo…
fxprunayre Apr 11, 2024
612b5be
Documentation / DCAT
fxprunayre Apr 12, 2024
43c2964
Documentation / DCAT / Image
fxprunayre Apr 12, 2024
c0d2a28
Standard / ISO / DCAT formatters / HVD extend DCAT-AP. Fix missing DC…
fxprunayre Apr 17, 2024
3e736e2
Test / EU-DCAT-AP / SHACL / Fix Jena issue.
fxprunayre Apr 17, 2024
7359700
Standard / ISO / DCAT formatters / Fix range for MediaTypeOrExtent.
fxprunayre Apr 17, 2024
817ac6c
Standard / ISO / DCAT formatters / SHACL / Rules are now working. The…
fxprunayre Apr 17, 2024
50db967
Standard / ISO / DCAT formatters / HVD / Fix test.
fxprunayre Apr 17, 2024
304bba9
Standard / ISO / DCAT formatters / Fix namespace of contactPoint.
fxprunayre Apr 23, 2024
56c7154
Standard / ISO / DCAT formatters / Better support multilingual records.
fxprunayre Apr 23, 2024
f45d4a4
Admin / CSW / Add more GET request examples.
fxprunayre Apr 23, 2024
5e9d0a8
Standard / ISO / DCAT formatters / Fix namespace of contactPoint
fxprunayre Apr 23, 2024
aa5f3c0
Standard / ISO / DCAT formatters / Better handle HVD concept by norma…
fxprunayre Apr 23, 2024
59eab9c
DCAT / Shacl rule update.
fxprunayre Apr 29, 2024
8bb3fcc
Merge remote-tracking branch 'origin/main' into dcat
fxprunayre Apr 29, 2024
10f63bc
Standards / ISO / Formatters / DCAT / Multilingual / Do not output empty
fxprunayre Apr 29, 2024
1d42c08
Standards / ISO / Formatters / DCAT / Distribution / Map taking into …
fxprunayre Apr 29, 2024
2d1e5d8
Standards / ISO / Formatters / DCAT / Period of time using beginPosit…
fxprunayre Apr 29, 2024
d5755c8
Merge remote-tracking branch 'origin/main' into dcat
fxprunayre Apr 29, 2024
5f34876
Standards / ISO / Formatters / DCAT / Documentation and entry point f…
fxprunayre Apr 30, 2024
7d2b6e6
Merge branch 'dcat' of https://github.com/SPW-DIG/metawal-core-geonet…
GeryNi May 8, 2024
df13b79
Updated license mapping to map to EU licenses for dcat-ap profile (an…
GeryNi May 8, 2024
c35b34d
Updated license mapping to map to EU licenses for dcat-ap profile (re…
GeryNi May 8, 2024
7398ba1
Standards / ISO / Formatters / DCAT / Update SEMICeu conversion - fol…
fxprunayre May 15, 2024
0bb68c1
Standards / ISO / Formatters / DCAT / Updates following GeoDCAT-AP wo…
fxprunayre May 16, 2024
6a3b7dc
Standards / ISO / Formatters / DCAT / Update SEMICeu conversion - fix…
fxprunayre May 16, 2024
fe54f4a
Standards / ISO / Formatters / DCAT / Update SEMICeu conversion - mor…
fxprunayre May 16, 2024
63db0da
Formatter / DCAT / ISO common name are unused for keywords
fxprunayre Jul 17, 2024
34cb78b
Formatter / DCAT / Mobility DCAT improvement.
fxprunayre Jul 18, 2024
53aeffc
Formatter / DCAT / accrualPeriodicity / Add support for userDefinedMa…
fxprunayre Jul 18, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 12 additions & 9 deletions core/src/main/java/org/fao/geonet/kernel/SchemaManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@
import java.util.Map;
import java.util.Set;
import java.util.regex.Pattern;
import java.util.stream.Collectors;

/**
* Class that handles all functions relating to metadata schemas. This includes
Expand Down Expand Up @@ -106,6 +107,7 @@ public class SchemaManager {
private static int activeWriters = 0;
private Map<String, Schema> hmSchemas = new HashMap<>();
private Map<String, Namespace> hmSchemasTypenames = new HashMap<>();
private Map<String, String> cswOutputSchemas = new HashMap<>();
private String[] fnames = {"labels.xml", "codelists.xml", "strings.xml"};
private Path schemaPluginsDir;
private Path schemaPluginsCat;
Expand Down Expand Up @@ -958,6 +960,7 @@ private void addSchema(ApplicationContext applicationContext, Path schemaDir, El

if (mds.getSchemaPlugin() != null && mds.getSchemaPlugin().getCswTypeNames() != null) {
hmSchemasTypenames.putAll(mds.getSchemaPlugin().getCswTypeNames());
cswOutputSchemas.putAll(mds.getSchemaPlugin().getOutputSchemas());
}

// -- add cached xml files (schema codelists and label files)
Expand Down Expand Up @@ -1926,17 +1929,17 @@ public Map<String, Namespace> getHmSchemasTypenames() {
}

/**
* Return the list of namespace URI of all typenames declared in all schema plugins.
* Return the list of outputSchema declared in all schema plugins.
*/
public Map<String, String> getOutputSchemas() {
return cswOutputSchemas;
}

/**
* Return the list of namespace URI of all outputSchema declared in all schema plugins.
*/
public List<String> getListOfOutputSchemaURI() {
Iterator<String> iterator = hmSchemasTypenames.keySet().iterator();
List<String> listOfSchemaURI = new ArrayList<>();
while (iterator.hasNext()) {
String typeLocalName = iterator.next();
Namespace ns = hmSchemasTypenames.get(typeLocalName);
listOfSchemaURI.add(ns.getURI());
}
return listOfSchemaURI;
return new ArrayList<>(cswOutputSchemas.values());
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@
import java.util.List;
import java.util.Map;
import java.util.Set;
import java.util.stream.Collectors;

import static org.fao.geonet.kernel.setting.SettingManager.isPortRequired;

Expand Down Expand Up @@ -529,6 +530,8 @@ private void setOperationsParameters(Element capabilities) {
*/
private void populateTypeNameAndOutputSchema(Element op) {
Map<String, Namespace> typenames = _schemaManager.getHmSchemasTypenames();
List<String> outputSchemas = _schemaManager.getOutputSchemas().values().stream().sorted().collect(Collectors.toList());

List<Element> operations = op.getChildren("Parameter", Csw.NAMESPACE_OWS);
for (Element operation : operations) {
if ("typeNames".equals(operation.getAttributeValue("name"))) {
Expand All @@ -541,12 +544,10 @@ private void populateTypeNameAndOutputSchema(Element op) {
.setText(typename));
}
} else if ("outputSchema".equals(operation.getAttributeValue("name"))) {
for (Map.Entry<String, Namespace> entry : typenames.entrySet()) {
Namespace ns = entry.getValue();
operation.addNamespaceDeclaration(ns);
outputSchemas.forEach(uri ->
operation.addContent(new Element("Value", Csw.NAMESPACE_OWS)
.setText(ns.getURI()));
}
.setText(uri))
);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,16 +78,16 @@ public static String parse(String schema, SchemaManager schemaManager) throws In
if (schema.equals("csw:IsoRecord")) return "gmd";
if (schema.equals("own")) return "own";

Map<String, Namespace> typenames = schemaManager.getHmSchemasTypenames();
for (Map.Entry<String, Namespace> entry : typenames.entrySet()) {
Namespace ns = entry.getValue();
if (schema.equals(ns.getURI())) {
return ns.getPrefix();
Map<String, String> typenames = schemaManager.getOutputSchemas();
for (Map.Entry<String, String> entry : typenames.entrySet()) {
String ns = entry.getValue();
if (schema.equals(ns)) {
return entry.getKey();
}
}

throw new InvalidParameterValueEx("outputSchema",
String.format("'%s' schema is not valid. Supported values are %s",
String.format("'%s' output schema is not valid. Supported values are %s",
schema,
schemaManager.getListOfOutputSchemaURI().toString()));
}
Expand Down
14 changes: 8 additions & 6 deletions csw-server/src/main/java/org/fao/geonet/csw/common/util/Xml.java
Original file line number Diff line number Diff line change
Expand Up @@ -125,22 +125,24 @@ public static Element applyElementSetName(ServiceContext context, SchemaManager
ResultType resultType, String id, String displayLanguage) throws InvalidParameterValueEx {
Path schemaDir = schemaManager.getSchemaCSWPresentDir(schema);
Path styleSheet = schemaDir.resolve(outputSchema + "-" + elementSetName + ".xsl");
Path styleSheetWithoutElementSet = schemaDir.resolve(outputSchema + ".xsl");

if (!Files.exists(styleSheet)) {
if (!Files.exists(styleSheet) && !Files.exists(styleSheetWithoutElementSet)) {
throw new InvalidParameterValueEx("OutputSchema",
String.format(
"OutputSchema '%s' not supported for metadata with '%s' (%s).\nCorresponding XSL transformation '%s' does not exist for this schema.\nThe record will not be returned in response.",
outputSchema, id, schema, styleSheet.getFileName()));
"OutputSchema '%s' not supported for metadata with '%s' (%s).\nCorresponding XSL transformation '%s' (or '%s') does not exist for this schema.\nThe record will not be returned in response.",
outputSchema, id, schema, styleSheet.getFileName(), styleSheetWithoutElementSet.getFileName()));
} else {
Map<String, Object> params = new HashMap<>();
params.put("lang", displayLanguage);

Path xslFile = Files.exists(styleSheet) ? styleSheet : styleSheetWithoutElementSet;
try {
result = org.fao.geonet.utils.Xml.transform(result, styleSheet, params);
result = org.fao.geonet.utils.Xml.transform(result, xslFile, params);
} catch (Exception e) {
String msg = String.format(
"Error occured while transforming metadata with id '%s' using '%s'.",
id, styleSheet.getFileName());
"Error occurred while transforming metadata with id '%s' using '%s'.",
id, xslFile.getFileName());
context.error(msg);
context.error(" (C) StackTrace:\n" + Util.getStackTrace(e));
throw new InvalidParameterValueEx("OutputSchema", msg);
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
137 changes: 122 additions & 15 deletions docs/manual/docs/api/rdf-dcat.md
Original file line number Diff line number Diff line change
@@ -1,24 +1,131 @@
# RDF DCAT end point {#rdf-dcat}
# DCAT {#rdf-dcat}

!!! warning
The catalogue has the capability to convert ISO to DCAT format in various API endpoint. [The first implementation of DCAT output was done in 2012](https://trac.osgeo.org/geonetwork/wiki/proposals/DCATandRDFServices) and was targeting interaction with semantic service and semantic sitemap support. DCAT output was available using a service named `rdf.search`. This service was deprecated in version 4.0.0 in favor of producing DCAT output in the [Catalog Service for the Web (CSW)](csw.md) or using the formatters API.

Unavailable since version 4.0.0.

There is no known sponsor or interested party for implementing RDF DCAT.
Interested parties may contact the project team for guidance and to express their intent.

The RDF DCAT end point provides a way of getting information about the catalog, the datasets and services, and links to distributed resources in a machine-readable format. The formats of the output are based on DCAT, an RDF vocabulary that is designed to facilitate interoperability between web-based data catalogs.
## Supported DCAT profiles

Reference:
A base conversion is provided with complementary extensions for various profiles of DCAT developed in Europe:

* [Data Catalog Vocabulary (DCAT)](https://www.w3.org/TR/vocab-dcat-3/)
* a default DCAT export following W3C standard https://www.w3.org/TR/vocab-dcat-3/
* an extension for the European DCAT-AP https://semiceu.github.io/DCAT-AP/releases/3.0.0/
* an extension for the European GeoDCAT-AP https://semiceu.github.io/GeoDCAT-AP/releases/
* an extension for the European DCAT-AP-Mobility https://mobilitydcat-ap.github.io/mobilityDCAT-AP/releases/1.0.0/index.html
* an extension for the European DCAT-AP-HVD https://semiceu.github.io/DCAT-AP/releases/2.2.0-hvd/

## Upgrading from GeoNetwork 3.0 Guidance
The mapping is done from ISO19115-3 to DCAT*. An ISO19139 to ISO19115-3 conversion can be applied before if needed.

RDF DCAT API is no longer available.
[The SEMICeu XSLT conversion](https://github.com/SEMICeu/iso-19139-to-dcat-ap/blob/master/iso-19139-to-dcat-ap.xsl)) is also included with minor improvements. This conversion is from ISO19139 to RDF and if needed a conversion from ISO19115-3 is applied.

1. We recommend migrating to use of [Catalog Service for the Web (CSW)](csw.md) API to query and explore data.
## Usage in the formatters API

2. When downloading using `GetRecord` make use of the `application/rdf+xml; charset=UTF-8` output format.

This will allow retrieving records in the same document format as previously provided by RDF DCAT api.
Each DCAT formats are available using a formatter eg. http://localhost:8080/geonetwork/srv/api/records/be44fe5a-65ca-4b70-9d29-ac5bf1f0ebc5/formatters/eu-dcat-ap?output=xml

To add the formatter in the record view download list, the user interface configuration can be updated:

![image](img/dcat-in-download-menu.png)

```json
{
"mods": {
"search": {
"downloadFormatter": [
{
"label": "exportMEF",
"url": "/formatters/zip?withRelated=false",
"class": "fa-file-zip-o"
},
{
"label": "exportPDF",
"url": "/formatters/xsl-view?output=pdf&language=${lang}",
"class": "fa-file-pdf-o"
},
{
"label": "exportXML",
"url": "/formatters/xml",
"class": "fa-file-code-o"
},
{
"label": "DCAT",
"url": "/formatters/dcat?output=xml"
},
{
"label": "EU-DCAT-AP",
"url": "/formatters/eu-dcat-ap?output=xml"
},
{
"label": "EU-GEO-DCAT-AP",
"url": "/formatters/eu-geodcat-ap?output=xml"
},
{
"label": "EU-DCAT-AP-MOBILITY",
"url": "/formatters/eu-dcat-ap-mobility?output=xml"
},
{
"label": "EU-DCAT-AP-HVD",
"url": "/formatters/eu-dcat-ap-hvd?output=xml"
}
]
```


## Usage in the CSW service

All DCAT profiles are also accessible using CSW protocol.

A `GetRecordById` operation can be used: http://localhost:8080/geonetwork/srv/eng/csw?SERVICE=CSW&VERSION=2.0.2&REQUEST=GetRecordById&ID=da165110-88fd-11da-a88f-000d939bc5d8&outputSchema=https://semiceu.github.io/DCAT-AP/releases/2.2.0-hvd/ and is equivalent to the API http://localhost:8080/geonetwork/srv/api/records/da165110-88fd-11da-a88f-000d939bc5d8/formatters/eu-dcat-ap-hvd?output=xml.

A `GetRecords` operation can be used to retrieve a set of records: http://localhost:8080/geonetwork/srv/fre/csw?SERVICE=CSW&VERSION=2.0.2&REQUEST=GetRecords&outputSchema=http://data.europa.eu/930/&elementSetName=full&resultType=results&maxRecords=300

Use the `outputSchema` parameter to select the DCAT profile to use. The following values are supported:

```xml
<ows:Parameter name="outputSchema">
<ows:Value>http://data.europa.eu/930/</ows:Value>
<ows:Value>http://data.europa.eu/930/#semiceu</ows:Value>
<ows:Value>http://data.europa.eu/r5r/</ows:Value>
<ows:Value>http://standards.iso.org/iso/19115/-3/mdb/2.0</ows:Value>
<ows:Value>http://www.isotc211.org/2005/gfc</ows:Value>
<ows:Value>http://www.isotc211.org/2005/gmd</ows:Value>
<ows:Value>http://www.opengis.net/cat/csw/2.0.2</ows:Value>
<ows:Value>http://www.w3.org/ns/dcat#</ows:Value>
<ows:Value>http://www.w3.org/ns/dcat#core</ows:Value>
<ows:Value>https://semiceu.github.io/DCAT-AP/releases/2.2.0-hvd/</ows:Value>
<ows:Value>https://w3id.org/mobilitydcat-ap</ows:Value>
```

Those values are listed in the `GetCapabilities` operation http://localhost:8080/geonetwork/srv/eng/csw?SERVICE=CSW&VERSION=2.0.2&REQUEST=GetCapabilities.

## Usage in OGC API Records

For the time being, OGC API Records provides a simplified DCAT output (based on the index document).

## DCAT validation

The DCAT validation can be done using online validation tool:
* https://www.itb.ec.europa.eu/shacl/dcat-ap/upload

Depending on the target DCAT profile to use, it may be required to build proper ISO template and metadata record containing all required fields. Usually profiles are adding constraints for usage of specific vocabularies and fields (eg. [for High Value datasets, specific vocabularies are defined for categories, license, applicable legislations, ...](https://semiceu.github.io/DCAT-AP/releases/2.2.0-hvd/#controlled-vocabularies-to-be-used)).


## Mapping considerations

The mapping is done from ISO19115-3 to DCAT. The mapping may not cover all usages and may be adapted. This can be done in the `iso19115-3.2018` schema plugin in the `formatter/dcat*` XSLT files.

Some points under discussion are:
* Object vs Reference:
* Should we use object or reference for some fields (eg. contact, organisation, ...)?
* What should be the reference URI?
* Where is defined the reference URI in ISO?

eg. for an organisation, the URI will be the first value in the following sequence:
```xml
(cit:partyIdentifier/*/mcc:code/*/text(),
cit:contactInfo/*/cit:onlineResource/*/cit:linkage/gco:CharacterString/text(),
cit:name/gcx:Anchor/@xlink:href,
@uuid)[1]
```

* No equivalent field in ISO (eg. Where to store `spdx:checksum` in ISO?)

* Associated resources: Links between are not always bidirectional so using the associated API would allow to populate more relations. This is also mitigated with the complete RDF graph of the catalogue is retrieved providing relations from all records.
7 changes: 6 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -469,7 +469,7 @@
<groupId>org.apache.jena</groupId>
<artifactId>apache-jena-libs</artifactId>
<type>pom</type>
<version>3.17.0</version>
<version>4.10.0</version>
</dependency>

<!-- PDF stuff: Managed by Mapfish -->
Expand Down Expand Up @@ -554,6 +554,11 @@
<artifactId>commons-email</artifactId>
<version>1.5</version>
</dependency>
<dependency>
<groupId>commons-codec</groupId>
<artifactId>commons-codec</artifactId>
<version>1.15</version>
</dependency>
<dependency>
<groupId>org.apache.xmlgraphics</groupId>
<artifactId>xmlgraphics-commons</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,12 @@

<bean id="iso19110SchemaPlugin"
class="org.fao.geonet.schema.iso19110.ISO19110SchemaPlugin">
<property name="outputSchemas">
<util:map key-type="java.lang.String" value-type="java.lang.String">
<entry key="csw" value="http://www.opengis.net/cat/csw/2.0.2"/>
<entry key="gfc" value="http://www.isotc211.org/2005/gfc"/>
</util:map>
</property>
<property name="xpathTitle">
<util:list value-type="java.lang.String">
<value>gmx:name/gco:CharacterString</value>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
<xsl:variable name="stylesheetVersion" select="'0.1'"/>


<xsl:template match="/">
<xsl:template match="/" name="to-iso19115-3">
<!--
root element (MD_Metadata or MI_Metadata)
-->
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns:locn="http://www.w3.org/ns/locn#"
xmlns:dcat="http://www.w3.org/ns/dcat#"
exclude-result-prefixes="#all">

<xsl:output method="xml"
indent="yes"
encoding="utf-8"
cdata-section-elements="locn:geometry dcat:bbox"/>

<xsl:template name="create-namespaces">
<xsl:namespace name="rdf" select="'http://www.w3.org/1999/02/22-rdf-syntax-ns#'"/>
<xsl:namespace name="rdfs" select="'http://www.w3.org/2000/01/rdf-schema#'"/>
<xsl:namespace name="owl" select="'http://www.w3.org/2002/07/owl#'"/>
<xsl:namespace name="dct" select="'http://purl.org/dc/terms/'"/>
<xsl:namespace name="dcat" select="'http://www.w3.org/ns/dcat#'"/>
<xsl:namespace name="foaf" select="'http://xmlns.com/foaf/0.1/'"/>
<xsl:namespace name="vcard" select="'http://www.w3.org/2006/vcard/ns#'"/>
<xsl:namespace name="prov" select="'http://www.w3.org/ns/prov#'"/>
<xsl:namespace name="org" select="'http://www.w3.org/ns/org#'"/>
<xsl:namespace name="pav" select="'http://purl.org/pav/'"/>
<xsl:namespace name="adms" select="'http://www.w3.org/ns/adms#'"/>
<xsl:namespace name="skos" select="'http://www.w3.org/2004/02/skos/core#'"/>
</xsl:template>
</xsl:stylesheet>
Loading