Skip to content
Snippets Groups Projects
Verified Commit 3937c093 authored by Jesper Zedlitz's avatar Jesper Zedlitz
Browse files

aktuellen Stand von main gemerged

parent 7c3001f3
No related branches found
No related tags found
No related merge requests found
Pipeline #705 passed
...@@ -657,21 +657,27 @@ public class MDMetadata2Dataset { ...@@ -657,21 +657,27 @@ public class MDMetadata2Dataset {
} }
Resource convertService(Element metadata) { Resource convertService(Element metadata) {
final Resource dataset; final Resource dataService;
final String id = getTextOrNull(metadata.selectSingleNode("gmd:fileIdentifier/gco:CharacterString")); final String id = getTextOrNull(metadata.selectSingleNode("gmd:fileIdentifier/gco:CharacterString"));
if (id != null) { if (id != null) {
dataset = model.createResource(settings.baseIRI + id); dataService = model.createResource(settings.baseIRI + id);
dataset.addLiteral(Adms.identifier, id.trim()); dataService.addLiteral(Adms.identifier, id.trim());
dataset.addLiteral(DCTerms.identifier, id.trim()); dataService.addLiteral(DCTerms.identifier, id.trim());
} else { } else {
dataset = model.createResource(); dataService = model.createResource();
} }
dataset.addProperty(RDF.type, DCAT.DataService); dataService.addProperty(RDF.type, DCAT.DataService);
convertCommonData(metadata, dataset); convertCommonData(metadata, dataService);
return dataset; String endpointDescription = getTextOrNull(metadata.selectSingleNode("gmd:identificationInfo/*/srv:containsOperations/*/srv:connectPoint/gmd:CI_OnlineResource/gmd:linkage/gmd:URL"));
if (isValidURLandIRI(endpointDescription)) {
dataService.addProperty(DCAT.endpointDescription, model.createResource(endpointDescription));
} else {
log.info("Service has invalid pointpoint description {}", endpointDescription);
}
return dataService;
} }
Resource convertSeries(Element metadata) { Resource convertSeries(Element metadata) {
...@@ -743,7 +749,6 @@ public class MDMetadata2Dataset { ...@@ -743,7 +749,6 @@ public class MDMetadata2Dataset {
for (Resource distribution : convertMultiFormatDataset(metadata)) { for (Resource distribution : convertMultiFormatDataset(metadata)) {
dataset.addProperty(DCAT.distribution, distribution); dataset.addProperty(DCAT.distribution, distribution);
} }
} else { } else {
final List<Node> onlineResourcesDownload = metadata.selectNodes("gmd:distributionInfo/*/gmd:transferOptions/*/gmd:onLine/*[gmd:function/*/@codeListValue='download' and gmd:linkage/*[text()]]"); final List<Node> onlineResourcesDownload = metadata.selectNodes("gmd:distributionInfo/*/gmd:transferOptions/*/gmd:onLine/*[gmd:function/*/@codeListValue='download' and gmd:linkage/*[text()]]");
for (Node onlineResource : onlineResourcesDownload) { for (Node onlineResource : onlineResourcesDownload) {
......
...@@ -1217,26 +1217,6 @@ public class MDMetadata2DatasetTests { ...@@ -1217,26 +1217,6 @@ public class MDMetadata2DatasetTests {
} }
/**
* The XPlanungsplattform sometimes sends incorrect license information for some datasets. Although the id of the
* license is invalide the URI of the license is correct.
*/
@Test
public void convert_incorrectLicense() throws DocumentException, IOException {
settings.findWMSinInfo = true;
final Document inputDocument = saxReader.read(getClass().getResourceAsStream("/e936ff9d-ba13-41eb-b0fa-41d5124496e0.xml"));
final Resource dataset = service.convert(inputDocument);
assertNotNull(dataset);
assertTrue(dataset.hasProperty(DCTerms.license, ResourceFactory.createResource("http://dcat-ap.de/def/licenses/dl-by-de/2.0")));
assertTrue(dataset.hasLiteral(DCATAPde.licenseAttributionByText, "Stadt Flensburg"));
final Resource distribution = collectDistributions(dataset).values().iterator().next();
assertTrue(distribution.hasProperty(DCTerms.license, ResourceFactory.createResource("http://dcat-ap.de/def/licenses/dl-by-de/2.0")));
assertTrue(distribution.hasLiteral(DCATAPde.licenseAttributionByText, "Stadt Flensburg"));
}
/** /**
* This serivce for an ATOM feed contains two transfer options: one for the feed itself and one for a viewer * This serivce for an ATOM feed contains two transfer options: one for the feed itself and one for a viewer
* application. * application.
......
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment