From a526bfbc3b4f982f23492e8e2c8b5919f95308a2 Mon Sep 17 00:00:00 2001 From: Adrian Wilke Date: Tue, 24 Mar 2020 15:05:00 +0100 Subject: [PATCH] 0.0.2 --- README.md | 401 +------------- pom.xml | 2 +- .../opal/licenses/old/Constants.java | 18 - .../opal/licenses/old/LicenseAttribute.java | 84 --- .../opal/licenses/old/LicenseCombinator.java | 373 ------------- .../old/LicenseCombinatorInterface.java | 71 --- .../dice_research/opal/licenses/old/ODRL.java | 118 ---- .../opal/licenses/old/cleaning/JavaApi.java | 38 -- .../old/cleaning/LicensePatterns.java | 127 ----- .../old/cleaning/LicenseReplacer.java | 35 -- .../opal/licenses/old/cleaning/Licenses.java | 47 -- .../licenses/old/cleaning/copy/JavaApi.java | 38 -- .../old/cleaning/copy/LicensePatterns.java | 127 ----- .../old/cleaning/copy/LicenseReplacer.java | 35 -- .../licenses/old/cleaning/copy/Licenses.java | 47 -- .../old/exceptions/LicensesException.java | 27 - .../exceptions/UnknownLicenseException.java | 27 - .../licenses/old/generator/LicencesGraph.java | 150 ----- .../licenses/old/transform/EdpCleaning.java | 136 ----- src/main/resources/old/edp-matrix.csv | 32 -- .../opal/licenses/DatasetExtractor.java | 115 ---- .../opal/licenses/LicensesTest.java | 339 ------------ .../opal/licenses/example/Example.java | 43 -- .../opal/licenses/datasets/odc-a.ttl | 518 ------------------ .../opal/licenses/datasets/odc-b.ttl | 77 --- .../opal/licenses/license-uris.txt | 38 -- .../opal/licenses/queries/catalogs.txt | 8 - .../opal/licenses/queries/dataset.txt | 9 - .../licenses/queries/datasets-by-license.txt | 14 - 29 files changed, 2 insertions(+), 3092 deletions(-) delete mode 100644 src/main/java/org/dice_research/opal/licenses/old/Constants.java delete mode 100644 src/main/java/org/dice_research/opal/licenses/old/LicenseAttribute.java delete mode 100644 src/main/java/org/dice_research/opal/licenses/old/LicenseCombinator.java delete mode 100644 src/main/java/org/dice_research/opal/licenses/old/LicenseCombinatorInterface.java delete mode 100644 src/main/java/org/dice_research/opal/licenses/old/ODRL.java delete mode 100644 src/main/java/org/dice_research/opal/licenses/old/cleaning/JavaApi.java delete mode 100644 src/main/java/org/dice_research/opal/licenses/old/cleaning/LicensePatterns.java delete mode 100644 src/main/java/org/dice_research/opal/licenses/old/cleaning/LicenseReplacer.java delete mode 100644 src/main/java/org/dice_research/opal/licenses/old/cleaning/Licenses.java delete mode 100644 src/main/java/org/dice_research/opal/licenses/old/cleaning/copy/JavaApi.java delete mode 100644 src/main/java/org/dice_research/opal/licenses/old/cleaning/copy/LicensePatterns.java delete mode 100644 src/main/java/org/dice_research/opal/licenses/old/cleaning/copy/LicenseReplacer.java delete mode 100644 src/main/java/org/dice_research/opal/licenses/old/cleaning/copy/Licenses.java delete mode 100644 src/main/java/org/dice_research/opal/licenses/old/exceptions/LicensesException.java delete mode 100644 src/main/java/org/dice_research/opal/licenses/old/exceptions/UnknownLicenseException.java delete mode 100644 src/main/java/org/dice_research/opal/licenses/old/generator/LicencesGraph.java delete mode 100644 src/main/java/org/dice_research/opal/licenses/old/transform/EdpCleaning.java delete mode 100644 src/main/resources/old/edp-matrix.csv delete mode 100644 src/test/java/org/dice_research/opal/licenses/DatasetExtractor.java delete mode 100644 src/test/java/org/dice_research/opal/licenses/LicensesTest.java delete mode 100644 src/test/java/org/dice_research/opal/licenses/example/Example.java delete mode 100644 src/test/resources/org/dice_research/opal/licenses/datasets/odc-a.ttl delete mode 100644 src/test/resources/org/dice_research/opal/licenses/datasets/odc-b.ttl delete mode 100644 src/test/resources/org/dice_research/opal/licenses/license-uris.txt delete mode 100644 src/test/resources/org/dice_research/opal/licenses/queries/catalogs.txt delete mode 100644 src/test/resources/org/dice_research/opal/licenses/queries/dataset.txt delete mode 100644 src/test/resources/org/dice_research/opal/licenses/queries/datasets-by-license.txt diff --git a/README.md b/README.md index 4b36fcd..5af155a 100644 --- a/README.md +++ b/README.md @@ -2,408 +2,9 @@ OPAL component managing DCAT licenses. -## Supported licenses - -The following knowlede graph lists the supported licenses including their permissions, prohibitions, and requirements. - -``` -@prefix cc: . -@prefix opal: . -@prefix odrl: . - - - a odrl:policy ; - odrl:permission [ odrl:action odrl:derive , odrl:distribute , odrl:reproduce ] ; - odrl:prohibition [] ; - odrl:requirement [ odrl:action cc:Attribution , cc:Notice ] . - - - a odrl:policy ; - odrl:permission [ odrl:action odrl:derive , odrl:distribute , odrl:reproduce ] ; - odrl:prohibition [] ; - odrl:requirement [ odrl:action cc:Attribution , cc:Notice ] . - - - a odrl:policy ; - odrl:permission [ odrl:action odrl:derive , odrl:distribute , odrl:reproduce ] ; - odrl:prohibition [] ; - odrl:requirement [ odrl:action cc:Attribution ] . - - - a odrl:policy ; - odrl:permission [ odrl:action odrl:derive , odrl:distribute , odrl:reproduce ] ; - odrl:prohibition [ odrl:action cc:CommercialUse ] ; - odrl:requirement [ odrl:action cc:Attribution ] . - - - a odrl:policy ; - odrl:permission [ odrl:action odrl:reproduce ] ; - odrl:prohibition [ odrl:action cc:CommercialUse ] ; - odrl:requirement [ odrl:action cc:Attribution , cc:Notice ] . - - - a odrl:policy ; - odrl:permission [ odrl:action odrl:derive , odrl:distribute , odrl:reproduce ] ; - odrl:prohibition [] ; - odrl:requirement [] . - - - a odrl:policy ; - odrl:permission [ odrl:action odrl:distribute , odrl:reproduce ] ; - odrl:prohibition [ odrl:action cc:CommercialUse ] ; - odrl:requirement [ odrl:action cc:Attribution , cc:Notice ] . - - - a odrl:policy ; - odrl:permission [ odrl:action odrl:derive , odrl:distribute , odrl:reproduce ] ; - odrl:prohibition [] ; - odrl:requirement [ odrl:action cc:Copyleft , cc:ShareAlike , cc:Attribution , cc:Notice ] . - - - a odrl:policy ; - odrl:permission [ odrl:action odrl:derive , odrl:distribute , odrl:reproduce ] ; - odrl:prohibition [] ; - odrl:requirement [ odrl:action cc:Copyleft , cc:ShareAlike , cc:Attribution , cc:Notice ] . - - - a odrl:policy ; - odrl:permission [ odrl:action odrl:derive , odrl:distribute , odrl:reproduce ] ; - odrl:prohibition [] ; - odrl:requirement [ odrl:action cc:Copyleft , cc:ShareAlike , cc:Attribution , cc:Notice ] . - - - a odrl:policy ; - odrl:permission [ odrl:action odrl:distribute , odrl:reproduce ] ; - odrl:prohibition [] ; - odrl:requirement [ odrl:action cc:Attribution , cc:Notice ] . - - - a odrl:policy ; - odrl:permission [ odrl:action odrl:derive , odrl:distribute , odrl:reproduce ] ; - odrl:prohibition [] ; - odrl:requirement [ odrl:action cc:Copyleft , cc:ShareAlike , cc:Attribution , cc:Notice ] . - - - a odrl:policy ; - odrl:permission [ odrl:action odrl:derive , odrl:distribute , odrl:reproduce ] ; - odrl:prohibition [] ; - odrl:requirement [ odrl:action cc:Attribution , cc:Notice ] . - - - a odrl:policy ; - odrl:permission [ odrl:action odrl:derive , odrl:distribute , odrl:reproduce ] ; - odrl:prohibition [] ; - odrl:requirement [] . - - - a odrl:policy ; - odrl:permission [ odrl:action odrl:derive , odrl:distribute , odrl:reproduce ] ; - odrl:prohibition [] ; - odrl:requirement [ odrl:action cc:Copyleft , cc:ShareAlike , cc:Attribution , cc:Notice ] . - - - a odrl:policy ; - odrl:permission [ odrl:action odrl:derive , odrl:distribute , odrl:reproduce ] ; - odrl:prohibition [] ; - odrl:requirement [ odrl:action cc:Attribution , cc:Notice ] . - - - a odrl:policy ; - odrl:permission [ odrl:action odrl:derive , odrl:distribute , odrl:reproduce ] ; - odrl:prohibition [ odrl:action cc:CommercialUse ] ; - odrl:requirement [ odrl:action cc:Attribution , cc:Notice ] . - - - a odrl:policy ; - odrl:permission [ odrl:action odrl:derive , odrl:distribute , odrl:reproduce ] ; - odrl:prohibition [] ; - odrl:requirement [ odrl:action cc:Attribution ] . - - - a odrl:policy ; - odrl:permission [ odrl:action odrl:derive , odrl:distribute , odrl:reproduce ] ; - odrl:prohibition [ odrl:action cc:CommercialUse ] ; - odrl:requirement [ odrl:action cc:Attribution , cc:Notice ] . - - - a odrl:policy ; - odrl:permission [ odrl:action odrl:derive , odrl:distribute , odrl:reproduce ] ; - odrl:prohibition [] ; - odrl:requirement [ odrl:action cc:Copyleft , cc:ShareAlike , cc:Attribution , cc:Notice ] . - - - a odrl:policy ; - odrl:permission [ odrl:action odrl:derive , odrl:distribute , odrl:reproduce ] ; - odrl:prohibition [] ; - odrl:requirement [ odrl:action cc:Attribution , cc:Notice ] . - - - a odrl:policy ; - odrl:permission [ odrl:action odrl:derive , odrl:distribute , odrl:reproduce ] ; - odrl:prohibition [] ; - odrl:requirement [ odrl:action cc:Attribution , cc:Notice ] . - - - a odrl:policy ; - odrl:permission [ odrl:action odrl:derive , odrl:distribute , odrl:reproduce ] ; - odrl:prohibition [] ; - odrl:requirement [ odrl:action cc:Attribution ] . - - - a odrl:policy ; - odrl:permission [ odrl:action odrl:derive , odrl:distribute , odrl:reproduce ] ; - odrl:prohibition [] ; - odrl:requirement [ odrl:action cc:Copyleft , cc:ShareAlike , cc:Attribution , cc:Notice ] . - - - a odrl:policy ; - odrl:permission [ odrl:action odrl:derive , odrl:distribute , odrl:reproduce ] ; - odrl:prohibition [] ; - odrl:requirement [ odrl:action cc:LesserCopyleft , cc:ShareAlike , cc:Attribution , cc:Notice ] . - - - a odrl:policy ; - odrl:permission [ odrl:action odrl:derive , odrl:distribute , odrl:reproduce ] ; - odrl:prohibition [] ; - odrl:requirement [ odrl:action cc:Attribution , cc:Notice ] . - - - a odrl:policy ; - odrl:permission [ odrl:action odrl:derive , odrl:distribute , odrl:reproduce ] ; - odrl:prohibition [ odrl:action cc:CommercialUse ] ; - odrl:requirement [ odrl:action cc:Copyleft , cc:ShareAlike , cc:Attribution , cc:Notice ] . - - - a odrl:policy ; - odrl:permission [ odrl:action odrl:derive , odrl:distribute , odrl:reproduce ] ; - odrl:prohibition [] ; - odrl:requirement [ odrl:action cc:Copyleft , cc:ShareAlike , cc:Attribution , cc:Notice ] . - - - a odrl:policy ; - odrl:permission [ odrl:action odrl:derive , odrl:distribute , odrl:reproduce ] ; - odrl:prohibition [] ; - odrl:requirement [ odrl:action cc:Copyleft , cc:ShareAlike , cc:Attribution , cc:Notice ] . - - - a odrl:policy ; - odrl:permission [ odrl:action odrl:derive , odrl:distribute , odrl:reproduce ] ; - odrl:prohibition [] ; - odrl:requirement [ odrl:action cc:Attribution , cc:Notice ] . - - - a odrl:policy ; - odrl:permission [ odrl:action odrl:derive , odrl:distribute , odrl:reproduce ] ; - odrl:prohibition [] ; - odrl:requirement [] . - - - a odrl:policy ; - odrl:permission [ odrl:action odrl:derive , odrl:distribute , odrl:reproduce ] ; - odrl:prohibition [] ; - odrl:requirement [] . -@prefix cc: . -@prefix opal: . -@prefix odrl: . - - - a odrl:policy ; - odrl:permission [ odrl:action odrl:derive , odrl:distribute , odrl:reproduce ] ; - odrl:prohibition [] ; - odrl:requirement [ odrl:action cc:Attribution , cc:Notice ] . - - - a odrl:policy ; - odrl:permission [ odrl:action odrl:derive , odrl:distribute , odrl:reproduce ] ; - odrl:prohibition [] ; - odrl:requirement [ odrl:action cc:Attribution , cc:Notice ] . - - - a odrl:policy ; - odrl:permission [ odrl:action odrl:derive , odrl:distribute , odrl:reproduce ] ; - odrl:prohibition [] ; - odrl:requirement [ odrl:action cc:Attribution ] . - - - a odrl:policy ; - odrl:permission [ odrl:action odrl:derive , odrl:distribute , odrl:reproduce ] ; - odrl:prohibition [ odrl:action cc:CommercialUse ] ; - odrl:requirement [ odrl:action cc:Attribution ] . - - - a odrl:policy ; - odrl:permission [ odrl:action odrl:reproduce ] ; - odrl:prohibition [ odrl:action cc:CommercialUse ] ; - odrl:requirement [ odrl:action cc:Attribution , cc:Notice ] . - - - a odrl:policy ; - odrl:permission [ odrl:action odrl:derive , odrl:distribute , odrl:reproduce ] ; - odrl:prohibition [] ; - odrl:requirement [] . - - - a odrl:policy ; - odrl:permission [ odrl:action odrl:distribute , odrl:reproduce ] ; - odrl:prohibition [ odrl:action cc:CommercialUse ] ; - odrl:requirement [ odrl:action cc:Attribution , cc:Notice ] . - - - a odrl:policy ; - odrl:permission [ odrl:action odrl:derive , odrl:distribute , odrl:reproduce ] ; - odrl:prohibition [] ; - odrl:requirement [ odrl:action cc:Copyleft , cc:ShareAlike , cc:Attribution , cc:Notice ] . - - - a odrl:policy ; - odrl:permission [ odrl:action odrl:derive , odrl:distribute , odrl:reproduce ] ; - odrl:prohibition [] ; - odrl:requirement [ odrl:action cc:Copyleft , cc:ShareAlike , cc:Attribution , cc:Notice ] . - - - a odrl:policy ; - odrl:permission [ odrl:action odrl:derive , odrl:distribute , odrl:reproduce ] ; - odrl:prohibition [] ; - odrl:requirement [ odrl:action cc:Copyleft , cc:ShareAlike , cc:Attribution , cc:Notice ] . - - - a odrl:policy ; - odrl:permission [ odrl:action odrl:distribute , odrl:reproduce ] ; - odrl:prohibition [] ; - odrl:requirement [ odrl:action cc:Attribution , cc:Notice ] . - - - a odrl:policy ; - odrl:permission [ odrl:action odrl:derive , odrl:distribute , odrl:reproduce ] ; - odrl:prohibition [] ; - odrl:requirement [ odrl:action cc:Copyleft , cc:ShareAlike , cc:Attribution , cc:Notice ] . - - - a odrl:policy ; - odrl:permission [ odrl:action odrl:derive , odrl:distribute , odrl:reproduce ] ; - odrl:prohibition [] ; - odrl:requirement [ odrl:action cc:Attribution , cc:Notice ] . - - - a odrl:policy ; - odrl:permission [ odrl:action odrl:derive , odrl:distribute , odrl:reproduce ] ; - odrl:prohibition [] ; - odrl:requirement [] . - - - a odrl:policy ; - odrl:permission [ odrl:action odrl:derive , odrl:distribute , odrl:reproduce ] ; - odrl:prohibition [] ; - odrl:requirement [ odrl:action cc:Copyleft , cc:ShareAlike , cc:Attribution , cc:Notice ] . - - - a odrl:policy ; - odrl:permission [ odrl:action odrl:derive , odrl:distribute , odrl:reproduce ] ; - odrl:prohibition [] ; - odrl:requirement [ odrl:action cc:Attribution , cc:Notice ] . - - - a odrl:policy ; - odrl:permission [ odrl:action odrl:derive , odrl:distribute , odrl:reproduce ] ; - odrl:prohibition [ odrl:action cc:CommercialUse ] ; - odrl:requirement [ odrl:action cc:Attribution , cc:Notice ] . - - - a odrl:policy ; - odrl:permission [ odrl:action odrl:derive , odrl:distribute , odrl:reproduce ] ; - odrl:prohibition [] ; - odrl:requirement [ odrl:action cc:Attribution ] . - - - a odrl:policy ; - odrl:permission [ odrl:action odrl:derive , odrl:distribute , odrl:reproduce ] ; - odrl:prohibition [ odrl:action cc:CommercialUse ] ; - odrl:requirement [ odrl:action cc:Attribution , cc:Notice ] . - - - a odrl:policy ; - odrl:permission [ odrl:action odrl:derive , odrl:distribute , odrl:reproduce ] ; - odrl:prohibition [] ; - odrl:requirement [ odrl:action cc:Copyleft , cc:ShareAlike , cc:Attribution , cc:Notice ] . - - - a odrl:policy ; - odrl:permission [ odrl:action odrl:derive , odrl:distribute , odrl:reproduce ] ; - odrl:prohibition [] ; - odrl:requirement [ odrl:action cc:Attribution , cc:Notice ] . - - - a odrl:policy ; - odrl:permission [ odrl:action odrl:derive , odrl:distribute , odrl:reproduce ] ; - odrl:prohibition [] ; - odrl:requirement [ odrl:action cc:Attribution , cc:Notice ] . - - - a odrl:policy ; - odrl:permission [ odrl:action odrl:derive , odrl:distribute , odrl:reproduce ] ; - odrl:prohibition [] ; - odrl:requirement [ odrl:action cc:Attribution ] . - - - a odrl:policy ; - odrl:permission [ odrl:action odrl:derive , odrl:distribute , odrl:reproduce ] ; - odrl:prohibition [] ; - odrl:requirement [ odrl:action cc:Copyleft , cc:ShareAlike , cc:Attribution , cc:Notice ] . - - - a odrl:policy ; - odrl:permission [ odrl:action odrl:derive , odrl:distribute , odrl:reproduce ] ; - odrl:prohibition [] ; - odrl:requirement [ odrl:action cc:LesserCopyleft , cc:ShareAlike , cc:Attribution , cc:Notice ] . - - - a odrl:policy ; - odrl:permission [ odrl:action odrl:derive , odrl:distribute , odrl:reproduce ] ; - odrl:prohibition [] ; - odrl:requirement [ odrl:action cc:Attribution , cc:Notice ] . - - - a odrl:policy ; - odrl:permission [ odrl:action odrl:derive , odrl:distribute , odrl:reproduce ] ; - odrl:prohibition [ odrl:action cc:CommercialUse ] ; - odrl:requirement [ odrl:action cc:Copyleft , cc:ShareAlike , cc:Attribution , cc:Notice ] . - - - a odrl:policy ; - odrl:permission [ odrl:action odrl:derive , odrl:distribute , odrl:reproduce ] ; - odrl:prohibition [] ; - odrl:requirement [ odrl:action cc:Copyleft , cc:ShareAlike , cc:Attribution , cc:Notice ] . - - - a odrl:policy ; - odrl:permission [ odrl:action odrl:derive , odrl:distribute , odrl:reproduce ] ; - odrl:prohibition [] ; - odrl:requirement [ odrl:action cc:Copyleft , cc:ShareAlike , cc:Attribution , cc:Notice ] . - - - a odrl:policy ; - odrl:permission [ odrl:action odrl:derive , odrl:distribute , odrl:reproduce ] ; - odrl:prohibition [] ; - odrl:requirement [ odrl:action cc:Attribution , cc:Notice ] . - - - a odrl:policy ; - odrl:permission [ odrl:action odrl:derive , odrl:distribute , odrl:reproduce ] ; - odrl:prohibition [] ; - odrl:requirement [] . - - - a odrl:policy ; - odrl:permission [ odrl:action odrl:derive , odrl:distribute , odrl:reproduce ] ; - odrl:prohibition [] ; - odrl:requirement [] . -``` - - ## Notes -* The data is based on the [European Data Portal Licence Compatibility Matrix](https://www.europeandataportal.eu/en/content/licence-assistant-european-data-portal-licence-compatibility-matrix) -* The used vocabulary is the [Open Digital Rights Language (ODRL)](https://www.w3.org/TR/odrl-model/) +* [Version 0.0.1](https://github.com/projekt-opal/licenses/releases/tag/0.0.1) contains a KnowledgeGraph based on the European Data Portal Licence Compatibility Matrix. It uses the Open Digital Rights Language (ODRL). Additionally, that version contains code to clean licenses, a first LicenseCombinator version, and SPARQL tools for EDP. ## Credits diff --git a/pom.xml b/pom.xml index dc8a219..7a7740b 100644 --- a/pom.xml +++ b/pom.xml @@ -13,7 +13,7 @@ 1.8 - 0.0.1-SNAPSHOT + 0.0.2 diff --git a/src/main/java/org/dice_research/opal/licenses/old/Constants.java b/src/main/java/org/dice_research/opal/licenses/old/Constants.java deleted file mode 100644 index 2b7028f..0000000 --- a/src/main/java/org/dice_research/opal/licenses/old/Constants.java +++ /dev/null @@ -1,18 +0,0 @@ -package org.dice_research.opal.licenses.old; - -/** - * Contains well-known string constants - * - * @author Jochen Vothknecht - */ -public class Constants { - - public static final String DCT_LICENSE = "http://purl.org/dc/terms/license"; - - public static final String NS_CC = "https://creativecommons.org/ns"; - - public static final String NS_ODRL = "http://www.w3.org/ns/odrl/2/"; - - public static final String NS_OPAL_LICENSES = "http://projekt-opal.de/licenses/"; - -} \ No newline at end of file diff --git a/src/main/java/org/dice_research/opal/licenses/old/LicenseAttribute.java b/src/main/java/org/dice_research/opal/licenses/old/LicenseAttribute.java deleted file mode 100644 index cf2b3cf..0000000 --- a/src/main/java/org/dice_research/opal/licenses/old/LicenseAttribute.java +++ /dev/null @@ -1,84 +0,0 @@ -package org.dice_research.opal.licenses.old; - -/** - * - * @author Jochen Vothknecht - */ -public interface LicenseAttribute { - - /** - * Used in searching for compatible licenses. - * - * If License A has Permission P, than License B is compatible to A if it either permits P or not. - * If A doesn't permit P, than B can't permit P either. - */ - public enum Permission implements LicenseAttribute { - REPRODUCTION { - public String toString() { - return Constants.NS_ODRL + "reproduce"; - } - }, - DISTRIBUTION { - public String toString() { - return Constants.NS_ODRL + "distribute"; - } - }, - DERIVATIVE { - public String toString() { - return Constants.NS_ODRL + "derive"; - } - }, - SUBLICENSING, - PATENTGRANT - } - - /** - * Used in searching for compatible licenses. - * - * If License A has Requirement R, than License B is compatible to A if it requires R too. - * If A doesn't require R, than B may or may not require R. - */ - public enum Requirement implements LicenseAttribute { - NOTICE { - public String toString() { - return Constants.NS_CC + "Notice"; - } - }, - ATTRIBUTION { - public String toString() { - return Constants.NS_CC + "Attribution"; - } - }, - SHAREALIKE { - public String toString() { - return Constants.NS_CC + "ShareAlike"; - } - }, - COPYLEFT { - public String toString() { - return Constants.NS_CC + "CopyLeft"; - } - }, - LESSERCOPYLEFT { - public String toString() { - return Constants.NS_CC + "LesserCopyleft"; - } - }, - STATECHANGES - } - - /** - * Used in searching for compatible licenses. - * - * If License A has Prohibition P, than License B is compatible to A if it prohibits P too. - * If A doesn't prohibit P, than B may or may not prohibit P. - */ - public enum Prohibition implements LicenseAttribute { - COMMERCIAL { - public String toString() { - return Constants.NS_CC + "CommercialUse"; - } - }, - USETRADEMARK - } -} diff --git a/src/main/java/org/dice_research/opal/licenses/old/LicenseCombinator.java b/src/main/java/org/dice_research/opal/licenses/old/LicenseCombinator.java deleted file mode 100644 index 92933fc..0000000 --- a/src/main/java/org/dice_research/opal/licenses/old/LicenseCombinator.java +++ /dev/null @@ -1,373 +0,0 @@ -package org.dice_research.opal.licenses.old; - -import java.io.File; -import java.io.IOException; -import java.lang.reflect.Field; -import java.nio.file.Files; -import java.util.Arrays; -import java.util.Collection; -import java.util.Comparator; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Iterator; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; -import java.util.function.Predicate; -import java.util.stream.Collectors; - -import org.apache.jena.rdf.model.Model; -import org.apache.jena.rdf.model.Property; -import org.apache.jena.rdf.model.RDFNode; -import org.apache.jena.rdf.model.Resource; -import org.apache.jena.rdf.model.SimpleSelector; -import org.apache.jena.rdf.model.StmtIterator; -import org.dice_research.opal.licenses.old.exceptions.UnknownLicenseException; - - -public class LicenseCombinator implements LicenseCombinatorInterface { - - public static final HashMap licenses; - - public static class License { - - /* - * Permissions - * - * This are negative properties. - * If one license in a combination doesn't give you a permission, the resulting license can't give it to you either. - */ - public final boolean reproduction; - public final boolean distribution; - public final boolean derivative; - public final boolean sublicensing; - public final boolean patentGrant; - - protected static final Map permissions; - - /* - * Requirements - * - * This are positive properties. - * If one license in a combination requires you to do something, the resulting license must require you to do this, too. - */ - public final boolean notice; - public final boolean attribution; - public final boolean shareAlike; - public final boolean copyLeft; - public final boolean lesserCopyLeft; - public final boolean stateChanges; - - protected static final Map requirements; - - // Prohibitions - public final boolean commercial; - public final boolean useTrademark; - - protected static final Map prohibitions; - - public final String name; - public final String licenseURI; - - /* - * Caching Field-objects heavily speeds up reflective accesses - */ - protected static final List booleanFields; - - static { - List fields = Arrays.asList(License.class.getDeclaredFields()); - booleanFields = fields.stream().filter(field -> field.getType().equals(boolean.class)).collect(Collectors.toList()); - - permissions = new HashMap<>(); - permissions.put("reproduction", LicenseAttribute.Permission.REPRODUCTION); - permissions.put("distribution", LicenseAttribute.Permission.DISTRIBUTION); - permissions.put("derivative", LicenseAttribute.Permission.DERIVATIVE); - permissions.put("sublicensing", LicenseAttribute.Permission.SUBLICENSING); - permissions.put("patentGrant", LicenseAttribute.Permission.PATENTGRANT); - - requirements = new HashMap<>(); - requirements.put("notice", LicenseAttribute.Requirement.NOTICE); - requirements.put("attribution", LicenseAttribute.Requirement.ATTRIBUTION); - requirements.put("shareAlike", LicenseAttribute.Requirement.SHAREALIKE); - requirements.put("copyLeft", LicenseAttribute.Requirement.COPYLEFT); - requirements.put("lesserCopyLeft", LicenseAttribute.Requirement.LESSERCOPYLEFT); - requirements.put("stateChanges", LicenseAttribute.Requirement.STATECHANGES); - - prohibitions = new HashMap<>(); - prohibitions.put("commercial", LicenseAttribute.Prohibition.COMMERCIAL); - prohibitions.put("useTrademark", LicenseAttribute.Prohibition.USETRADEMARK); - } - - public License( - String name, - String licenseURI, - - boolean reproduction, - boolean distribution, - boolean derivative, - boolean sublicensing, - boolean patentGrant, - - boolean notice, - boolean attribution, - boolean shareAlike, - boolean copyLeft, - boolean lesserCopyLeft, - boolean stateChanges, - - boolean commercial, - boolean useTrademark - ) { - this.name = name; - this.licenseURI = licenseURI; - - this.reproduction = reproduction; - this.distribution= distribution; - this.derivative = derivative; - this.sublicensing = sublicensing; - this.patentGrant = patentGrant; - - this.notice = notice; - this.attribution = attribution; - this.shareAlike = shareAlike; - this.copyLeft = copyLeft; - this.lesserCopyLeft = lesserCopyLeft; - this.stateChanges = stateChanges; - - this.commercial = commercial; - this.useTrademark = useTrademark; - } - - /** - * Creates a predicate for matching compatible licenses - * - * @return the predicate - */ - public Predicate createPredicate() { - return (License other) -> { - - for (Field field : booleanFields) { - try { - if (field.getBoolean(this) && !field.getBoolean(other)) return false; - } catch (Exception e) { - e.printStackTrace(); - return false; - } - } - - return true; - }; - } - - protected static LicenseAttribute attrName2attr(String name) { - if (permissions.containsKey(name)) return permissions.get(name); - else if (requirements.containsKey(name)) return requirements.get(name); - else if (prohibitions.containsKey(name)) return prohibitions.get(name); - else throw new RuntimeException("Unknown attribute: " + name); - } - } - - static { - licenses = new HashMap(); - - try { - Files.lines(new File("edp-matrix.csv").toPath()).forEach((String line) -> { - String fields[] = line.split(","); - - String licenseName = fields[0]; - String licenseURI = fields[1]; - - boolean bFields[] = new boolean[fields.length - 2]; - - for (int i = 2; i < fields.length; i++) { - bFields[i - 2] = "Yes".equals(fields[i]); - } - - licenses.put(licenseURI, new License( - licenseName, licenseURI, - bFields[0], bFields[1], - bFields[2], bFields[3], - bFields[4], bFields[5], - bFields[6], bFields[7], - bFields[8], bFields[9], - bFields[10], bFields[11], - bFields[12] - )); - }); - } catch (IOException e) { - e.printStackTrace(); - } - } - - public static License getLicense(String uri) throws UnknownLicenseException { - License license = licenses.get(uri); - - if (license == null) throw new UnknownLicenseException(uri); - - return license; - } - - public Collection getLicenses(Collection licenseURIs) throws UnknownLicenseException { - try { - return licenseURIs.stream().map(uri -> { - try { - return getLicense(uri); - } catch (UnknownLicenseException ule) { - throw new RuntimeException(ule); - } - }).collect(Collectors.toSet()); - } catch (RuntimeException re) { - Throwable cause = re.getCause(); - - if (cause instanceof UnknownLicenseException) { - throw (UnknownLicenseException)cause; - } else { - throw re; - } - } - } - - @Override - public List getLicenseSuggestions(Collection usedLicenseUris) throws UnknownLicenseException { - if (usedLicenseUris.size() < 1) return new LinkedList(); - - Collection usedLicenses = getLicenses(usedLicenseUris); - - Iterator licenseIterator = usedLicenses.iterator(); - Predicate predicate = licenseIterator.next().createPredicate(); - while (licenseIterator.hasNext()) { - predicate = predicate.and(licenseIterator.next().createPredicate()); - } - - List applicableLicenses = LicenseCombinator.licenses.values().stream().filter(predicate).collect(Collectors.toList()); - - applicableLicenses.sort(new Comparator() { - - private boolean licenseArrayContains(License license) { - for (License l : usedLicenses) { - if (license.name.equals(l.name)) return true; - } - - return false; - } - - /** - * compares two licenses simply by the fact that they are contained in input set or not - */ - @Override - public int compare(License l0, License l1) { - boolean containsL0 = licenseArrayContains(l0); - boolean containsL1 = licenseArrayContains(l1); - - if (containsL0 && containsL1) return 0; - else if (containsL0) return -1; - else return 1; - } - }); - - return applicableLicenses.stream().map(license -> license.licenseURI).collect(Collectors.toList()); - } - - - - @Override - public Map getLicenseAttributes(Collection usedLicenseUris) throws UnknownLicenseException { - if (usedLicenseUris.size() < 1) throw new IllegalArgumentException(); - - HashMap out = new HashMap<>(); - - try { - Iterator licenseIterator = getLicenses(usedLicenseUris).iterator(); - while (licenseIterator.hasNext()) { - License l = licenseIterator.next(); - - for (Field f : License.booleanFields) { - String licenseFieldName = f.getName(); - boolean licenseFieldValue = f.getBoolean(l); - Boolean licenseFieldOutValue = out.get(License.attrName2attr(licenseFieldName)); - - if (licenseFieldOutValue == null) { - out.put(License.attrName2attr(licenseFieldName), licenseFieldValue); - } else if (License.permissions.containsKey(licenseFieldName) && !licenseFieldValue) { - out.put(License.permissions.get(licenseFieldName), licenseFieldValue); - } else if (License.requirements.containsKey(licenseFieldName) && !licenseFieldOutValue) { - out.put(License.requirements.get(licenseFieldName), licenseFieldValue); - } else if (License.prohibitions.containsKey(licenseFieldName) && !licenseFieldOutValue) { - out.put(License.prohibitions.get(licenseFieldName), licenseFieldValue); - } - } - } - } catch (Throwable e) { - e.printStackTrace(); - } - - return out; - } - - @Override - public List getLicenseFromAttributes(Map attributes) { - - Collection allAttributes = new HashSet<>(); - allAttributes.addAll(License.permissions.values()); - allAttributes.addAll(License.requirements.values()); - allAttributes.addAll(License.prohibitions.values()); - - // add missing attributes to allow input of sparse maps - for (LicenseAttribute l : allAttributes) { - if (!attributes.containsKey(l)) attributes.put(l, false); - } - - List applicableLicenses = LicenseCombinator.licenses.values().stream().filter(license -> { - for (Field field : License.booleanFields) { - try { - if (attributes.get(License.attrName2attr(field.getName())) && !field.getBoolean(license)) return false; - } catch (NullPointerException npe) { - throw new IllegalArgumentException("Missing attribute: " + field.getName()); - } catch (Exception e) { - e.printStackTrace(); - return false; - } - } - - return true; - }).collect(Collectors.toList()); - - return applicableLicenses.stream().map(license -> license.licenseURI).collect(Collectors.toList()); - } - - private Collection getLicensesFromModel(Model m) { - Collection licenses = new HashSet<>(); - - Property p = m.createProperty(Constants.DCT_LICENSE); - StmtIterator it = m.listStatements(new SimpleSelector((Resource)null, p, (RDFNode)null)); - while (it.hasNext()) { - licenses.add(it.next().getObject().toString()); // works for resources and literals - } - - return licenses; - } - - @Override - public Collection> getLicenseSuggestions(Model model0, Model model1) throws UnknownLicenseException { - Collection> out = new HashSet<>(); - - Collection licensesM0 = getLicensesFromModel(model0); - Collection licensesM1 = getLicensesFromModel(model1); - - for (String licenseM0 : licensesM0) { - for (String licenseM1 : licensesM1) { - Collection licenses = new LinkedList<>(); - - licenses.add(licenseM0); - licenses.add(licenseM1); - - out.add(getLicenseSuggestions(licenses)); - } - } - - List empty = new LinkedList<>(); - out.remove(empty); - - return out; - } -} diff --git a/src/main/java/org/dice_research/opal/licenses/old/LicenseCombinatorInterface.java b/src/main/java/org/dice_research/opal/licenses/old/LicenseCombinatorInterface.java deleted file mode 100644 index 8a40782..0000000 --- a/src/main/java/org/dice_research/opal/licenses/old/LicenseCombinatorInterface.java +++ /dev/null @@ -1,71 +0,0 @@ -package org.dice_research.opal.licenses.old; - -import java.util.Collection; -import java.util.List; -import java.util.Map; - -import org.apache.jena.rdf.model.Model; -import org.dice_research.opal.licenses.old.exceptions.UnknownLicenseException; - -/** - * Components implementing this interface create suggestions for possible - * licenses to be combined. It is based on a collection of input licenses, which - * are related to restrictions to be met. - * - * @author Adrian Wilke - */ -public interface LicenseCombinatorInterface { - - /** - * Suggests licenses for a combination of different input licenses. - * - * @param usedLicenseUris A collection of license-URIs, which have to be - * considered for suggesting possible licenses. - * - * @return A list of URIs of licenses, which can be used related to restrictions - * of the input licenses. The list is ordered. If it contains licenses - * contained in the input, these should be listed at top. If licenses - * are more probable, e.g. by their openness, they should be listed - * before others. The returned list may be empty. - * - * - * @throws UnknownLicenseException If an input-URI is not known. - */ - List getLicenseSuggestions(Collection usedLicenseUris) throws UnknownLicenseException; - - /** - * Computes the attribute set of the smallest denominator of different input licenses. - * - * @param usedLicenceUris A non-empty collection of license-URIs, which have to be - * considered for computing license attributes. - * - * @return A map containing various license attributes. - * - * @throws UnknownLicenseException If an input-URI is not known. - * @throws IllegalArgumentException If the input collection is empty - */ - Map getLicenseAttributes(Collection usedLicenseUris) throws UnknownLicenseException; - - /** - * Searches for licenses compatible to the given attributes. - * - * @param attributes A map containing various license attributes. - * - * @return A list of licenses, which are compatible to the given attributes. May be empty if no matching license could be found. - */ - List getLicenseFromAttributes(Map attributes); - - /** - * Suggests licenses for a combination of different input licenses gathered from 2 Jena models. - * - * Licenses are found by DCAT's dct:license property. - * Input models should contain one dataset and may contain zero or more distributions of the dataset. - * - * @param model0 First input model - * @param model1 Second input model - * @return A Set of license suggestions - * @throws UnknownLicenseException If a model contains some unknown license-URI - */ - Collection> getLicenseSuggestions(Model model0, Model model1) throws UnknownLicenseException; - -} \ No newline at end of file diff --git a/src/main/java/org/dice_research/opal/licenses/old/ODRL.java b/src/main/java/org/dice_research/opal/licenses/old/ODRL.java deleted file mode 100644 index 7f2dfca..0000000 --- a/src/main/java/org/dice_research/opal/licenses/old/ODRL.java +++ /dev/null @@ -1,118 +0,0 @@ -package org.dice_research.opal.licenses.old; - -import java.io.File; -import java.io.IOException; -import java.nio.file.Files; - -import org.apache.jena.rdf.model.Model; -import org.apache.jena.rdf.model.ModelFactory; -import org.apache.jena.rdf.model.Property; -import org.apache.jena.rdf.model.Resource; -import org.apache.jena.vocabulary.RDF; - -public class ODRL { - - public static final Model model; - - private enum OptionalBoolean { - UNDEFINED, FALSE, TRUE - } - - static { - model = ModelFactory.createDefaultModel(); - - model.setNsPrefix("opal", Constants.NS_OPAL_LICENSES); - model.setNsPrefix("odrl", Constants.NS_ODRL); - model.setNsPrefix("cc", Constants.NS_CC); - - try { - // model.read(new FileInputStream(new File("src/main/resources/ODRL22.ttl")), - // null, "TURTLE"); - - Files.lines(new File("edp-matrix.csv").toPath()).forEach((String line) -> { - String fields[] = line.split(","); - - // String licenseName = fields[0]; - String licenseURI = fields[1]; - - OptionalBoolean bFields[] = new OptionalBoolean[fields.length - 2]; - - for (int i = 2; i < fields.length; i++) { - if ("Yes".equals(fields[i])) - bFields[i - 2] = OptionalBoolean.TRUE; - else if ("No".equals(fields[i])) - bFields[i - 2] = OptionalBoolean.FALSE; - else - bFields[i - 2] = OptionalBoolean.UNDEFINED; - } - - // Permissions - OptionalBoolean reproduction = bFields[0]; - OptionalBoolean distribution = bFields[1]; - OptionalBoolean derivative = bFields[2]; - // OptionalBoolean sublicensing = bFields[3]; // not supported by ODRL / CC-REL - // OptionalBoolean patentGrant = bFields[4]; // not supported by ODRL / CC-REL - - // Requirements - OptionalBoolean notice = bFields[5]; // CC-REL only - OptionalBoolean attribution = bFields[6]; // CC-REL only - OptionalBoolean shareAlike = bFields[7]; // CC-REL only - OptionalBoolean copyleft = bFields[8]; // CC-REL only - OptionalBoolean lesserCopyleft = bFields[9]; // CC-REL only - // OptionalBoolean stateChanges = bFields[10]; // not supported by CC-REL / ODRL - - // Prohibitions - OptionalBoolean commercialUse = bFields[11]; // CC-REL only - // OptionalBoolean useTrademark = bFields[12]; // not supported by CC-REL - - Resource license = model.createResource(licenseURI); - license.addProperty(RDF.type, model.createResource(Constants.NS_ODRL + "policy")); - - Property permission = model.createProperty(Constants.NS_ODRL + "permission"); - Resource permissions = model.createResource(); - license.addProperty(permission, permissions); - - Property requirement = model.createProperty(Constants.NS_ODRL + "requirement"); - Resource requirements = model.createResource(); - license.addProperty(requirement, requirements); - - Property prohibition = model.createProperty(Constants.NS_ODRL + "prohibition"); - Resource prohibitions = model.createResource(); - license.addProperty(prohibition, prohibitions); - - Property action = model.createProperty(Constants.NS_ODRL + "action"); - - if (reproduction == OptionalBoolean.TRUE) - permissions.addProperty(action, model.createProperty(Constants.NS_ODRL + "reproduce")); - if (distribution == OptionalBoolean.TRUE) - permissions.addProperty(action, model.createProperty(Constants.NS_ODRL + "distribute")); - if (derivative == OptionalBoolean.TRUE) - permissions.addProperty(action, model.createProperty(Constants.NS_ODRL + "derive")); - - if (notice == OptionalBoolean.TRUE) - requirements.addProperty(action, model.createProperty(Constants.NS_CC + "Notice")); - if (attribution == OptionalBoolean.TRUE) - requirements.addProperty(action, model.createProperty(Constants.NS_CC + "Attribution")); - if (shareAlike == OptionalBoolean.TRUE) - requirements.addProperty(action, model.createProperty(Constants.NS_CC + "ShareAlike")); - if (copyleft == OptionalBoolean.TRUE) - requirements.addProperty(action, model.createProperty(Constants.NS_CC + "Copyleft")); - if (lesserCopyleft == OptionalBoolean.TRUE) - requirements.addProperty(action, model.createProperty(Constants.NS_CC + "LesserCopyleft")); - - if (commercialUse == OptionalBoolean.TRUE) - prohibitions.addProperty(action, model.createProperty(Constants.NS_CC + "CommercialUse")); - - }); - } catch (IOException e) { - e.printStackTrace(); - } - - // try { - // model.write(new FileOutputStream(new File("licenses.ttl")), "TURTLE"); - model.write(System.out, "TURTLE"); - // } catch (FileNotFoundException e) { - // e.printStackTrace(); - // } - } -} diff --git a/src/main/java/org/dice_research/opal/licenses/old/cleaning/JavaApi.java b/src/main/java/org/dice_research/opal/licenses/old/cleaning/JavaApi.java deleted file mode 100644 index c61a7b2..0000000 --- a/src/main/java/org/dice_research/opal/licenses/old/cleaning/JavaApi.java +++ /dev/null @@ -1,38 +0,0 @@ -package org.dice_research.opal.licenses.old.cleaning; - -import org.apache.jena.rdf.model.Model; -import org.dice_research.opal.common.interfaces.JenaModelProcessor; -import org.dice_research.opal.common.interfaces.ModelProcessor; - -/** - * Public API for other Java components. - * - * @author Adrian Wilke - */ -@SuppressWarnings("deprecation") -public class JavaApi implements ModelProcessor, JenaModelProcessor { - - @Override - public void processModel(Model model, String datasetUri) throws Exception { - new Licenses().process(model, datasetUri); - } - - /** - * @deprecated Replaced by {@link #processModel(Model, String)}. - */ - @Deprecated - @Override - public Model process(Model model, String datasetUri) throws Exception { - processModel(model, datasetUri); - return model; - } - - /** - * @deprecated Replaced by {@link #processModel(Model, String)}. - */ - @Deprecated - public Model process(Model model) throws Exception { - processModel(model, null); - return model; - } -} \ No newline at end of file diff --git a/src/main/java/org/dice_research/opal/licenses/old/cleaning/LicensePatterns.java b/src/main/java/org/dice_research/opal/licenses/old/cleaning/LicensePatterns.java deleted file mode 100644 index 2cdc9e1..0000000 --- a/src/main/java/org/dice_research/opal/licenses/old/cleaning/LicensePatterns.java +++ /dev/null @@ -1,127 +0,0 @@ -package org.dice_research.opal.licenses.old.cleaning; - -import java.io.FileOutputStream; -import java.util.Collection; -import java.util.LinkedList; - -import org.apache.jena.rdf.model.Literal; -import org.apache.jena.rdf.model.Model; -import org.apache.jena.rdf.model.ModelFactory; -import org.apache.jena.rdf.model.NodeIterator; -import org.apache.jena.rdf.model.Property; -import org.apache.jena.rdf.model.RDFNode; -import org.apache.jena.rdf.model.ResIterator; -import org.apache.jena.rdf.model.Resource; -import org.apache.jena.rdf.model.Selector; -import org.apache.jena.rdf.model.SimpleSelector; -import org.dice_research.opal.licenses.old.Constants; - - -/** - * - * Manager of a RDF Model which stores regexes to unify license URIs - * - * @author Jochen Vothknecht - */ -public class LicensePatterns { - - /** - * The default list of LicenseReplacers - */ - public static Collection replacers; - - static { - LicensePatterns.replacers = new LinkedList<>(); - - Model m = LicensePatterns.getModel(); - - Property plpat = m.createProperty("opal", ":licensePattern"); - Property prpat = m.createProperty("opal", ":licenseReplacement"); - - ResIterator iterator = m.listResourcesWithProperty(plpat); - while (iterator.hasNext()) { - Resource res = iterator.next(); - - Selector sel = new SimpleSelector(res, (Property)null, (RDFNode)null); - Model tmp = m.query(sel); - - NodeIterator it = tmp.listObjectsOfProperty(plpat); - String pattern = it.next().toString(); - - it = tmp.listObjectsOfProperty(prpat); - String replace = it.next().toString(); - - LicensePatterns.replacers.add(new LicenseReplacer(pattern, replace)); - } - - } - - /** - * Processes a given URI by the LicenseReplacers - * @param license the license URI to process - * @return the processed URI - */ - public static String replace(final String license) { - String out = license; - - for (LicenseReplacer licRep : LicensePatterns.replacers) { - out = licRep.replace(out); - } - - return out; - } - - /** - * Reads the patterns model from file - * @return the model - */ - public static Model getModel() { - Model m = ModelFactory.createDefaultModel(); - m.read("LicensePatterns.ttl"); - return m; - } - - /** - * Adds a URI pattern to specified model - * @param m the model - * @param name the name for the pattern - * @param pattern the regex - * @param replacement the replacement pattern - */ - public static void addPatternToModel(Model m, String name, String pattern, String replacement) { - Resource rpat = m.createResource(Constants.NS_OPAL_LICENSES + name); - Property plpat = m.createProperty(Constants.NS_OPAL_LICENSES + "licensePattern"); - Property prpat = m.createProperty(Constants.NS_OPAL_LICENSES + "licenseReplacement"); - Literal lpat = m.createLiteral(pattern); - Literal lrep = m.createLiteral(replacement); - - m.add(m.createStatement(rpat, plpat, lpat)); - m.add(m.createStatement(rpat, prpat, lrep)); - } - - /** - * Creates a default model and writes it to disk - * @param args ignored - */ - public static void main(String[] args) { - Model m = ModelFactory.createDefaultModel(); - m.setNsPrefix("opal", Constants.NS_OPAL_LICENSES); - - - LicensePatterns.addPatternToModel(m, - "europeandataportal", - "http[s]?://(?:www\\.)?europeandataportal\\.eu/content/show-license\\?license_id=(.*)", - "http://europeandataportal.eu/content/show-license?license_id=$1"); - - - try { - FileOutputStream fos = new FileOutputStream("LicensePatterns.ttl"); - m.write(fos, "TURTLE"); - fos.close(); - } catch (Exception e) { - e.printStackTrace(); - } - - //Model unused = ODRL.model; - } -} diff --git a/src/main/java/org/dice_research/opal/licenses/old/cleaning/LicenseReplacer.java b/src/main/java/org/dice_research/opal/licenses/old/cleaning/LicenseReplacer.java deleted file mode 100644 index b0d467f..0000000 --- a/src/main/java/org/dice_research/opal/licenses/old/cleaning/LicenseReplacer.java +++ /dev/null @@ -1,35 +0,0 @@ -package org.dice_research.opal.licenses.old.cleaning; - -import java.util.regex.Matcher; -import java.util.regex.Pattern; - - -/** - * Simple regex-replacing utility class - * @author Jochen Vothknecht - */ -public class LicenseReplacer { - - private Pattern pattern; - private String replace; - - public LicenseReplacer(String pattern, String replace) { - this.pattern = Pattern.compile(pattern); - this.replace = replace; - } - - /** - * Replaces the string if it matches the pattern - * @param license license URI - * @return either the original or the modified string - */ - public String replace(String license) { - Matcher m = pattern.matcher(license); - - if (m.matches()) { - return m.replaceAll(replace); - } else { - return license; - } - } -} diff --git a/src/main/java/org/dice_research/opal/licenses/old/cleaning/Licenses.java b/src/main/java/org/dice_research/opal/licenses/old/cleaning/Licenses.java deleted file mode 100644 index 53c6b1b..0000000 --- a/src/main/java/org/dice_research/opal/licenses/old/cleaning/Licenses.java +++ /dev/null @@ -1,47 +0,0 @@ -package org.dice_research.opal.licenses.old.cleaning; - -import org.apache.jena.graph.Triple; -import org.apache.jena.rdf.model.Model; -import org.apache.jena.rdf.model.ModelFactory; -import org.apache.jena.rdf.model.Property; -import org.apache.jena.rdf.model.Resource; -import org.apache.jena.rdf.model.Statement; -import org.apache.jena.rdf.model.StmtIterator; -import org.dice_research.opal.licenses.old.Constants; -import org.dice_research.opal.licenses.old.exceptions.LicensesException; - - -public class Licenses { - - private void mapLicense(Model m, Statement stmt) { - Triple t = stmt.asTriple(); - String license = t.getObject().toString(); - - license = LicensePatterns.replace(license); - - Resource res = m.createResource(t.getSubject().toString()); - Property prop = m.createProperty(t.getPredicate().toString()); - - m.add(m.createStatement(res, prop, license)); - } - - public boolean isLicenseStatement(Statement stmt) { - return Constants.DCT_LICENSE.equals(stmt.asTriple().getPredicate().toString()); - } - - public Model process(Model model, String datasetUri) throws LicensesException { - Model returnModel = ModelFactory.createDefaultModel(); - - StmtIterator stmts = model.listStatements(); - - while (stmts.hasNext()) { - Statement stmt = stmts.next(); - - if (isLicenseStatement(stmt)) mapLicense(returnModel, stmt); - else returnModel.add(stmt); - } - - return returnModel; - } - -} \ No newline at end of file diff --git a/src/main/java/org/dice_research/opal/licenses/old/cleaning/copy/JavaApi.java b/src/main/java/org/dice_research/opal/licenses/old/cleaning/copy/JavaApi.java deleted file mode 100644 index 5338863..0000000 --- a/src/main/java/org/dice_research/opal/licenses/old/cleaning/copy/JavaApi.java +++ /dev/null @@ -1,38 +0,0 @@ -package org.dice_research.opal.licenses.old.cleaning.copy; - -import org.apache.jena.rdf.model.Model; -import org.dice_research.opal.common.interfaces.JenaModelProcessor; -import org.dice_research.opal.common.interfaces.ModelProcessor; - -/** - * Public API for other Java components. - * - * @author Adrian Wilke - */ -@SuppressWarnings("deprecation") -public class JavaApi implements ModelProcessor, JenaModelProcessor { - - @Override - public void processModel(Model model, String datasetUri) throws Exception { - new Licenses().process(model, datasetUri); - } - - /** - * @deprecated Replaced by {@link #processModel(Model, String)}. - */ - @Deprecated - @Override - public Model process(Model model, String datasetUri) throws Exception { - processModel(model, datasetUri); - return model; - } - - /** - * @deprecated Replaced by {@link #processModel(Model, String)}. - */ - @Deprecated - public Model process(Model model) throws Exception { - processModel(model, null); - return model; - } -} \ No newline at end of file diff --git a/src/main/java/org/dice_research/opal/licenses/old/cleaning/copy/LicensePatterns.java b/src/main/java/org/dice_research/opal/licenses/old/cleaning/copy/LicensePatterns.java deleted file mode 100644 index a60163b..0000000 --- a/src/main/java/org/dice_research/opal/licenses/old/cleaning/copy/LicensePatterns.java +++ /dev/null @@ -1,127 +0,0 @@ -package org.dice_research.opal.licenses.old.cleaning.copy; - -import java.io.FileOutputStream; -import java.util.Collection; -import java.util.LinkedList; - -import org.apache.jena.rdf.model.Literal; -import org.apache.jena.rdf.model.Model; -import org.apache.jena.rdf.model.ModelFactory; -import org.apache.jena.rdf.model.NodeIterator; -import org.apache.jena.rdf.model.Property; -import org.apache.jena.rdf.model.RDFNode; -import org.apache.jena.rdf.model.ResIterator; -import org.apache.jena.rdf.model.Resource; -import org.apache.jena.rdf.model.Selector; -import org.apache.jena.rdf.model.SimpleSelector; -import org.dice_research.opal.licenses.old.Constants; - - -/** - * - * Manager of a RDF Model which stores regexes to unify license URIs - * - * @author Jochen Vothknecht - */ -public class LicensePatterns { - - /** - * The default list of LicenseReplacers - */ - public static Collection replacers; - - static { - LicensePatterns.replacers = new LinkedList<>(); - - Model m = LicensePatterns.getModel(); - - Property plpat = m.createProperty("opal", ":licensePattern"); - Property prpat = m.createProperty("opal", ":licenseReplacement"); - - ResIterator iterator = m.listResourcesWithProperty(plpat); - while (iterator.hasNext()) { - Resource res = iterator.next(); - - Selector sel = new SimpleSelector(res, (Property)null, (RDFNode)null); - Model tmp = m.query(sel); - - NodeIterator it = tmp.listObjectsOfProperty(plpat); - String pattern = it.next().toString(); - - it = tmp.listObjectsOfProperty(prpat); - String replace = it.next().toString(); - - LicensePatterns.replacers.add(new LicenseReplacer(pattern, replace)); - } - - } - - /** - * Processes a given URI by the LicenseReplacers - * @param license the license URI to process - * @return the processed URI - */ - public static String replace(final String license) { - String out = license; - - for (LicenseReplacer licRep : LicensePatterns.replacers) { - out = licRep.replace(out); - } - - return out; - } - - /** - * Reads the patterns model from file - * @return the model - */ - public static Model getModel() { - Model m = ModelFactory.createDefaultModel(); - m.read("LicensePatterns.ttl"); - return m; - } - - /** - * Adds a URI pattern to specified model - * @param m the model - * @param name the name for the pattern - * @param pattern the regex - * @param replacement the replacement pattern - */ - public static void addPatternToModel(Model m, String name, String pattern, String replacement) { - Resource rpat = m.createResource(Constants.NS_OPAL_LICENSES + name); - Property plpat = m.createProperty(Constants.NS_OPAL_LICENSES + "licensePattern"); - Property prpat = m.createProperty(Constants.NS_OPAL_LICENSES + "licenseReplacement"); - Literal lpat = m.createLiteral(pattern); - Literal lrep = m.createLiteral(replacement); - - m.add(m.createStatement(rpat, plpat, lpat)); - m.add(m.createStatement(rpat, prpat, lrep)); - } - - /** - * Creates a default model and writes it to disk - * @param args ignored - */ - public static void main(String[] args) { - Model m = ModelFactory.createDefaultModel(); - m.setNsPrefix("opal", Constants.NS_OPAL_LICENSES); - - - LicensePatterns.addPatternToModel(m, - "europeandataportal", - "http[s]?://(?:www\\.)?europeandataportal\\.eu/content/show-license\\?license_id=(.*)", - "http://europeandataportal.eu/content/show-license?license_id=$1"); - - - try { - FileOutputStream fos = new FileOutputStream("LicensePatterns.ttl"); - m.write(fos, "TURTLE"); - fos.close(); - } catch (Exception e) { - e.printStackTrace(); - } - - //Model unused = ODRL.model; - } -} diff --git a/src/main/java/org/dice_research/opal/licenses/old/cleaning/copy/LicenseReplacer.java b/src/main/java/org/dice_research/opal/licenses/old/cleaning/copy/LicenseReplacer.java deleted file mode 100644 index 517638b..0000000 --- a/src/main/java/org/dice_research/opal/licenses/old/cleaning/copy/LicenseReplacer.java +++ /dev/null @@ -1,35 +0,0 @@ -package org.dice_research.opal.licenses.old.cleaning.copy; - -import java.util.regex.Matcher; -import java.util.regex.Pattern; - - -/** - * Simple regex-replacing utility class - * @author Jochen Vothknecht - */ -public class LicenseReplacer { - - private Pattern pattern; - private String replace; - - public LicenseReplacer(String pattern, String replace) { - this.pattern = Pattern.compile(pattern); - this.replace = replace; - } - - /** - * Replaces the string if it matches the pattern - * @param license license URI - * @return either the original or the modified string - */ - public String replace(String license) { - Matcher m = pattern.matcher(license); - - if (m.matches()) { - return m.replaceAll(replace); - } else { - return license; - } - } -} diff --git a/src/main/java/org/dice_research/opal/licenses/old/cleaning/copy/Licenses.java b/src/main/java/org/dice_research/opal/licenses/old/cleaning/copy/Licenses.java deleted file mode 100644 index e3edf6c..0000000 --- a/src/main/java/org/dice_research/opal/licenses/old/cleaning/copy/Licenses.java +++ /dev/null @@ -1,47 +0,0 @@ -package org.dice_research.opal.licenses.old.cleaning.copy; - -import org.apache.jena.graph.Triple; -import org.apache.jena.rdf.model.Model; -import org.apache.jena.rdf.model.ModelFactory; -import org.apache.jena.rdf.model.Property; -import org.apache.jena.rdf.model.Resource; -import org.apache.jena.rdf.model.Statement; -import org.apache.jena.rdf.model.StmtIterator; -import org.dice_research.opal.licenses.old.Constants; -import org.dice_research.opal.licenses.old.exceptions.LicensesException; - - -public class Licenses { - - private void mapLicense(Model m, Statement stmt) { - Triple t = stmt.asTriple(); - String license = t.getObject().toString(); - - license = LicensePatterns.replace(license); - - Resource res = m.createResource(t.getSubject().toString()); - Property prop = m.createProperty(t.getPredicate().toString()); - - m.add(m.createStatement(res, prop, license)); - } - - public boolean isLicenseStatement(Statement stmt) { - return Constants.DCT_LICENSE.equals(stmt.asTriple().getPredicate().toString()); - } - - public Model process(Model model, String datasetUri) throws LicensesException { - Model returnModel = ModelFactory.createDefaultModel(); - - StmtIterator stmts = model.listStatements(); - - while (stmts.hasNext()) { - Statement stmt = stmts.next(); - - if (isLicenseStatement(stmt)) mapLicense(returnModel, stmt); - else returnModel.add(stmt); - } - - return returnModel; - } - -} \ No newline at end of file diff --git a/src/main/java/org/dice_research/opal/licenses/old/exceptions/LicensesException.java b/src/main/java/org/dice_research/opal/licenses/old/exceptions/LicensesException.java deleted file mode 100644 index ee11bdc..0000000 --- a/src/main/java/org/dice_research/opal/licenses/old/exceptions/LicensesException.java +++ /dev/null @@ -1,27 +0,0 @@ -package org.dice_research.opal.licenses.old.exceptions; - -public class LicensesException extends Exception { - - private static final long serialVersionUID = 1L; - - public LicensesException() { - super(); - } - - public LicensesException(String message) { - super(message); - } - - public LicensesException(String message, Throwable cause) { - super(message, cause); - } - - public LicensesException(Throwable cause) { - super(cause); - } - - protected LicensesException(String message, Throwable cause, boolean enableSuppression, - boolean writableStackTrace) { - super(message, cause, enableSuppression, writableStackTrace); - } -} \ No newline at end of file diff --git a/src/main/java/org/dice_research/opal/licenses/old/exceptions/UnknownLicenseException.java b/src/main/java/org/dice_research/opal/licenses/old/exceptions/UnknownLicenseException.java deleted file mode 100644 index 4deff91..0000000 --- a/src/main/java/org/dice_research/opal/licenses/old/exceptions/UnknownLicenseException.java +++ /dev/null @@ -1,27 +0,0 @@ -package org.dice_research.opal.licenses.old.exceptions; - -public class UnknownLicenseException extends LicensesException { - - private static final long serialVersionUID = 1L; - - public UnknownLicenseException() { - super(); - } - - public UnknownLicenseException(String message) { - super(message); - } - - public UnknownLicenseException(String message, Throwable cause) { - super(message, cause); - } - - public UnknownLicenseException(Throwable cause) { - super(cause); - } - - protected UnknownLicenseException(String message, Throwable cause, boolean enableSuppression, - boolean writableStackTrace) { - super(message, cause, enableSuppression, writableStackTrace); - } -} \ No newline at end of file diff --git a/src/main/java/org/dice_research/opal/licenses/old/generator/LicencesGraph.java b/src/main/java/org/dice_research/opal/licenses/old/generator/LicencesGraph.java deleted file mode 100644 index 6d8980f..0000000 --- a/src/main/java/org/dice_research/opal/licenses/old/generator/LicencesGraph.java +++ /dev/null @@ -1,150 +0,0 @@ -package org.dice_research.opal.licenses.old.generator; - -import java.io.File; -import java.io.IOException; -import java.nio.file.Files; - -import org.apache.jena.rdf.model.Model; -import org.apache.jena.rdf.model.ModelFactory; -import org.apache.jena.rdf.model.Property; -import org.apache.jena.rdf.model.Resource; -import org.apache.jena.vocabulary.RDF; -import org.dice_research.opal.common.utilities.FileHandler; -import org.dice_research.opal.licenses.old.Constants; - -/** - * Licence knowledge graph. - * - * @author Jochen Vothknecht - * @author Adrian Wilke - */ -public class LicencesGraph { - - public static final String EDP_MATRIX = "edp-matrix.csv"; - - /** - * Main entry point. - * - * @param args - */ - public static void main(String[] args) { - LicencesGraph odrl = new LicencesGraph().parseCsv(new File(EDP_MATRIX)); - - // Print model - if (Boolean.TRUE) { - odrl.model.write(System.out, "TURTLE"); - } - - // Write model to file - if (Boolean.FALSE) { - try { - File outFile = File.createTempFile("licences.", ".ttl"); - FileHandler.export(outFile, odrl.model); - odrl.model.write(System.out, "TURTLE"); - System.out - .println("Wrote model to: " + outFile.getAbsolutePath() + " " + LicencesGraph.class.getName()); - } catch (Exception e) { - throw new RuntimeException(e); - } - } - } - - protected Model model; - - protected enum OptionalBoolean { - UNDEFINED, FALSE, TRUE - } - - /** - * Parses CSV file and creates {@link #model}. - */ - protected LicencesGraph parseCsv(File csvFile) { - - model = ModelFactory.createDefaultModel(); - model.setNsPrefix("opal", Constants.NS_OPAL_LICENSES); - model.setNsPrefix("odrl", Constants.NS_ODRL); - model.setNsPrefix("cc", Constants.NS_CC); - - try { - Files.lines(csvFile.toPath()).forEach((String line) -> { - String fields[] = line.split(","); - - // String licenseName = fields[0]; - String licenseURI = fields[1]; - - OptionalBoolean bFields[] = new OptionalBoolean[fields.length - 2]; - - for (int i = 2; i < fields.length; i++) { - if ("Yes".equals(fields[i])) - bFields[i - 2] = OptionalBoolean.TRUE; - else if ("No".equals(fields[i])) - bFields[i - 2] = OptionalBoolean.FALSE; - else - bFields[i - 2] = OptionalBoolean.UNDEFINED; - } - - // Permissions - OptionalBoolean reproduction = bFields[0]; - OptionalBoolean distribution = bFields[1]; - OptionalBoolean derivative = bFields[2]; - // OptionalBoolean sublicensing = bFields[3]; // not supported by ODRL / CC-REL - // OptionalBoolean patentGrant = bFields[4]; // not supported by ODRL / CC-REL - - // Requirements - OptionalBoolean notice = bFields[5]; // CC-REL only - OptionalBoolean attribution = bFields[6]; // CC-REL only - OptionalBoolean shareAlike = bFields[7]; // CC-REL only - OptionalBoolean copyleft = bFields[8]; // CC-REL only - OptionalBoolean lesserCopyleft = bFields[9]; // CC-REL only - // OptionalBoolean stateChanges = bFields[10]; // not supported by CC-REL / ODRL - - // Prohibitions - OptionalBoolean commercialUse = bFields[11]; // CC-REL only - // OptionalBoolean useTrademark = bFields[12]; // not supported by CC-REL - - Resource license = model.createResource(licenseURI); - license.addProperty(RDF.type, model.createResource(Constants.NS_ODRL + "policy")); - - Property permission = model.createProperty(Constants.NS_ODRL + "permission"); - Resource permissions = model.createResource(); - license.addProperty(permission, permissions); - - Property requirement = model.createProperty(Constants.NS_ODRL + "requirement"); - Resource requirements = model.createResource(); - license.addProperty(requirement, requirements); - - Property prohibition = model.createProperty(Constants.NS_ODRL + "prohibition"); - Resource prohibitions = model.createResource(); - license.addProperty(prohibition, prohibitions); - - Property action = model.createProperty(Constants.NS_ODRL + "action"); - - if (reproduction == OptionalBoolean.TRUE) - permissions.addProperty(action, model.createProperty(Constants.NS_ODRL + "reproduce")); - if (distribution == OptionalBoolean.TRUE) - permissions.addProperty(action, model.createProperty(Constants.NS_ODRL + "distribute")); - if (derivative == OptionalBoolean.TRUE) - permissions.addProperty(action, model.createProperty(Constants.NS_ODRL + "derive")); - - if (notice == OptionalBoolean.TRUE) - requirements.addProperty(action, model.createProperty(Constants.NS_CC + "Notice")); - if (attribution == OptionalBoolean.TRUE) - requirements.addProperty(action, model.createProperty(Constants.NS_CC + "Attribution")); - if (shareAlike == OptionalBoolean.TRUE) - requirements.addProperty(action, model.createProperty(Constants.NS_CC + "ShareAlike")); - if (copyleft == OptionalBoolean.TRUE) - requirements.addProperty(action, model.createProperty(Constants.NS_CC + "Copyleft")); - if (lesserCopyleft == OptionalBoolean.TRUE) - requirements.addProperty(action, model.createProperty(Constants.NS_CC + "LesserCopyleft")); - - if (commercialUse == OptionalBoolean.TRUE) - prohibitions.addProperty(action, model.createProperty(Constants.NS_CC + "CommercialUse")); - - }); - } catch (IOException e) { - throw new RuntimeException(e); - } - - return this; - } -} \ No newline at end of file diff --git a/src/main/java/org/dice_research/opal/licenses/old/transform/EdpCleaning.java b/src/main/java/org/dice_research/opal/licenses/old/transform/EdpCleaning.java deleted file mode 100644 index 9e1523f..0000000 --- a/src/main/java/org/dice_research/opal/licenses/old/transform/EdpCleaning.java +++ /dev/null @@ -1,136 +0,0 @@ -package org.dice_research.opal.licenses.old.transform; - -import java.io.File; -import java.io.FileReader; -import java.io.IOException; -import java.net.URL; -import java.nio.charset.StandardCharsets; -import java.util.HashMap; -import java.util.LinkedHashMap; -import java.util.Map; -import java.util.Map.Entry; -import java.util.stream.Collectors; - -import org.apache.commons.csv.CSVFormat; -import org.apache.commons.csv.CSVPrinter; -import org.apache.commons.csv.CSVRecord; -import org.apache.commons.io.FileUtils; -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; -import org.dice_research.opal.licenses.utils.Io; - -/** - * Checks SPARQL results (CSV file) for duplicate keys ('license') and combines - * them by summing up values ('count'). - * - * @author Adrian Wilke - */ -public class EdpCleaning { - - // Configuration: URLs and files - public static final String SOURCE_URL = "https://hobbitdata.informatik.uni-leipzig.de/OPAL/Statistics/Licenses/2020-03-05-EDP-Licenses-Distributions.csv"; - public static final String SOURCE_FILE_PREFIX = "EDP-Licenses-Distributions-"; - - // Configuration: File handling - public static final boolean DELETE_SOURCE = true; - - private static final Logger LOGGER = LogManager.getLogger(); - - /** - * Main entry point. - */ - public static void main(String[] args) throws IOException { - new EdpCleaning().clean(); - } - - /** - * Sorts map by value. - * - * @see https://dzone.com/articles/how-to-sort-a-map-by-value-in-java-8 - */ - public static Map sortByValue(final Map map) { - return map.entrySet().stream().sorted((Map.Entry.comparingByValue().reversed())) - .collect(Collectors.toMap(Map.Entry::getKey, Map.Entry::getValue, (e1, e2) -> e1, LinkedHashMap::new)); - } - - /** - * Cleans EDP license data as given by {@link #SOURCE_URL}. - */ - private void clean() throws IOException { - - // Download - File sourceFile = download(); - if (DELETE_SOURCE) { - sourceFile.deleteOnExit(); - } else { - LOGGER.info("Downloaded file: " + sourceFile.getAbsolutePath()); - } - - // Parse - Map map = parseCsv(sourceFile); - int counter = 0; - for (Integer count : map.values()) { - counter += count; - } - LOGGER.info("Number of entries: " + counter); - - // Sort by value - map = sortByValue(map); - - // Write - StringBuilder stringBuilder = new StringBuilder(); - putCsv(map, stringBuilder); - File outFile = new File(SOURCE_URL.substring(SOURCE_URL.lastIndexOf("/") + 1)); - FileUtils.write(outFile, stringBuilder, StandardCharsets.UTF_8); - LOGGER.info("Wrote file: " + outFile.getAbsolutePath()); - } - - protected void putCsv(Map map, Appendable appendable) throws IOException { - CSVPrinter csvPrinter = CSVFormat.DEFAULT.withHeader("license", "count").print(appendable); - for (Entry entry : map.entrySet()) { - csvPrinter.printRecord(entry.getKey(), entry.getValue()); - } - csvPrinter.flush(); - csvPrinter.close(); - } - - /** - * Parses CSV. Ignores first line. - */ - protected Map parseCsv(File file) throws IOException { - Map map = new HashMap<>(); - Iterable records = CSVFormat.DEFAULT.withFirstRecordAsHeader().parse(new FileReader(file)); - int inputCounter = 0; - for (CSVRecord csvRecord : records) { - String license = csvRecord.get(0); - int count = Integer.parseInt(csvRecord.get(1)); - inputCounter += count; - if (map.containsKey(license)) { - map.put(license, map.get(license) + count); - LOGGER.info("Duplicate entry: " + license); - } else { - map.put(license, count); - } - } - - // Check counters - int outputCounter = 0; - for (Integer count : map.values()) { - outputCounter += count; - } - if (inputCounter != outputCounter) { - throw new IOException("In: " + inputCounter + ", out: " + outputCounter); - } - - return map; - } - - /** - * Downloads URL data to temporary file. - */ - protected File download() throws IOException { - File file = File.createTempFile(SOURCE_FILE_PREFIX, ".csv"); - Io.download(new URL(SOURCE_URL), file); - return file; - } -} \ No newline at end of file diff --git a/src/main/resources/old/edp-matrix.csv b/src/main/resources/old/edp-matrix.csv deleted file mode 100644 index 189fa9e..0000000 --- a/src/main/resources/old/edp-matrix.csv +++ /dev/null @@ -1,32 +0,0 @@ -CC0 1.0,https://creativecommons.org/publicdomain/zero/1.0/legalcode,Yes,Yes,Yes,Yes,No,No,No,No,No,No,No,No,No -CC-PDM 1.0,http://creativecommons.org/publicdomain/mark/1.0/,Yes,Yes,Yes,N.A.,No,No,No,No,No,No,No,No,No -CC-BY-ND 4.0,http://creativecommons.org/licenses/by-nd/4.0/legalcode,Yes,Yes,No,No,No,Yes,Yes,No,No,No,Yes,No,No -CC-BY-NC-ND 4.0,http://creativecommons.org/licenses/by-nc-nd/4.0/legalcode,Yes,Yes,No,No,No,Yes,Yes,No,No,No,Yes,Yes,No -CC-BY 4.0,http://creativecommons.org/licenses/by/4.0/legalcode,Yes,Yes,Yes,No,No,Yes,Yes,No,No,No,Yes,No,No -CC-BY-SA 4.0,http://creativecommons.org/licenses/by-sa/4.0/legalcode,Yes,Yes,Yes,No,No,Yes,Yes,Yes,Yes,No,Yes,No,No -CC-BY-NC 4.0,http://creativecommons.org/licenses/by-nc/4.0/legalcode,Yes,Yes,Yes,No,No,Yes,Yes,No,No,No,Yes,Yes,No -CC-BY-NC-SA 4.0,http://creativecommons.org/licenses/by-nc-sa/4.0/legalcode,Yes,Yes,Yes,No,No,Yes,Yes,Yes,Yes,No,Yes,Yes,No -CC BY 3.0 Austria,https://creativecommons.org/licenses/by/3.0/at/legalcode,Yes,Yes,Yes,No,No,Yes,Yes,No,No,No,No,No,No -NLOD,http://data.norge.no/nlod/en/1.0,Yes,Yes,Yes,No,No,Yes,Yes,Yes,Yes,No,No,No,No -OGL-ROU-1.0,http://data.gov.ro/base/images/logoinst/OGL-ROU-1.0.pdf,Yes,Yes,Yes,Yes,No,No,Yes,No,No,No,No,No,No -CC-BY 3.0 NL,http://creativecommons.org/licenses/by/3.0/nl/legalcode,Yes,Yes,Yes,No,No,Yes,Yes,No,No,No,No,No,No -CC-BY-SA 3.0 NL,http://creativecommons.org/licenses/by-sa/3.0/nl/legalcode,Yes,Yes,Yes,No,No,Yes,Yes,Yes,No,Yes,No,No,No -IODL v1.0,http://www.formez.it/iodl/,Yes,Yes,Yes,No,No,Yes,Yes,Yes,Yes,No,No,No,No -IODL v2.0,http://www.dati.gov.it/iodl/2.0/,Yes,Yes,Yes,No,No,Yes,Yes,No,No,No,No,No,No -ODC-PDDL,http://opendatacommons.org/licenses/pddl/1-0/,Yes,Yes,Yes,Yes,No,No,No,No,No,No,No,No,No -ODC-BY,http://opendatacommons.org/licenses/by/1.0/,Yes,Yes,Yes,No,No,Yes,Yes,Yes,Yes,No,No,No,No -ODC-ODbL,http://opendatacommons.org/licenses/odbl/1.0/,Yes,Yes,Yes,No,No,Yes,Yes,Yes,Yes,No,No,No,No -OGL 1.0,http://www.nationalarchives.gov.uk/doc/open-government-licence/version/1/,Yes,Yes,Yes,Yes,No,Yes,Yes,No,No,No,No,No,No -OGL 2.0,http://www.nationalarchives.gov.uk/doc/open-government-licence/version/2/,Yes,Yes,Yes,Yes,No,Yes,Yes,No,No,No,No,No,No -OGL 3.0,http://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/,Yes,Yes,Yes,Yes,No,Yes,Yes,No,No,No,No,No,No -OGL-NC,http://www.nationalarchives.gov.uk/doc/non-commercial-government-licence/non-commercial-government-licence.htm,Yes,Yes,Yes,Yes,No,Yes,Yes,No,No,No,No,Yes,No -DL-DE-ZERO 2.0,https://www.govdata.de/dl-de/zero-2-0,Yes,Yes,Yes,Yes,No,No,No,No,No,No,No,No,No -DL-DE-BY 2.0,https://www.govdata.de/dl-de/by-2-0,Yes,Yes,Yes,Yes,No,Yes,Yes,No,No,No,Yes,No,No -DL-DE-BY 1.0,https://www.govdata.de/dl-de/by-1-0,Yes,Yes,Yes,Yes,No,No,Yes,No,No,No,Yes,No,No -DL-DE-BY-NC 1.0,https://www.govdata.de/dl-de/by-nc-1-0,Yes,Yes,Yes,Yes,No,No,Yes,No,No,No,Yes,Yes,No -EUPL-1.1,https://joinup.ec.europa.eu/software/page/eupl/licence-eupl,Yes,Yes,Yes,Yes,Yes,Yes,Yes,Yes,Yes,No,No,No,No -FR-LO,https://www.etalab.gouv.fr/licence-ouverte-open-licence,Yes,Yes,Yes,No,Yes,No,Yes,No,No,No,No,No,No -PSEUL,http://www.ordnancesurvey.co.uk/business-and-government/public-sector/mapping-agreements/inspire-licence.html,Yes,No,No,No,No,Yes,Yes,No,No,No,No,Yes,No -GFDL-1.1,https://gnu.org/licenses/old-licenses/fdl-1.1,Yes,Yes,Yes,No,No,Yes,Yes,Yes,Yes,No,Yes,No,No -GFDL-1.2,https://gnu.org/licenses/old-licenses/fdl-1.2,Yes,Yes,Yes,No,No,Yes,Yes,Yes,Yes,No,Yes,No,No -GFDL-1.3,https://gnu.org/licenses/fdl-1.3.en.html,Yes,Yes,Yes,No,No,Yes,Yes,Yes,Yes,No,Yes,No,No diff --git a/src/test/java/org/dice_research/opal/licenses/DatasetExtractor.java b/src/test/java/org/dice_research/opal/licenses/DatasetExtractor.java deleted file mode 100644 index 44c9b83..0000000 --- a/src/test/java/org/dice_research/opal/licenses/DatasetExtractor.java +++ /dev/null @@ -1,115 +0,0 @@ -package org.dice_research.opal.licenses; - -import java.io.File; -import java.io.IOException; -import java.nio.charset.StandardCharsets; -import java.util.LinkedList; -import java.util.List; - -import org.apache.commons.io.FileUtils; -import org.apache.jena.query.QueryExecution; -import org.apache.jena.query.QueryExecutionFactory; -import org.apache.jena.query.ResultSet; -import org.apache.jena.rdf.model.Model; -import org.apache.jena.riot.Lang; -import org.apache.jena.riot.RDFDataMgr; -import org.apache.logging.log4j.LogManager; -import org.apache.logging.log4j.Logger; - -/** - * Helper class to extract datasets for test cases. - * - * Use {@link #main(String[])} and call {@link #getDataset(String)} to extract - * dataset TURTLE. - * - * @author Adrian Wilke - */ -@SuppressWarnings("unused") -public class DatasetExtractor { - - private final static String ENDPOINT_FUSEKI = "http://opalpro.cs.upb.de:3030/opal/sparql"; - private final static String ENDPOINT_VIRTUOSO = "http://opalpro.cs.upb.de:8891/sparql"; - private final static String ENDPOINT = ENDPOINT_VIRTUOSO; - - // License URI examples (see OPAL D3.3) - private final static String URI_OGL_A = "http://europeandataportal.eu/content/show-license?license_id=OGL2.0"; - private final static String URI_OGL_B = "https://www.europeandataportal.eu/content/show-license?license_id=OGL2.0"; - private final static String URI_ODC_A = "https://www.europeandataportal.eu/content/show-license?license_id=ODC-ODbL"; - private final static String URI_ODC_B = "http://europeandataportal.eu/content/show-license?license_id=ODC-ODbL"; - - // Distribution has license - // http://europeandataportal.eu/content/show-license?license_id=OGL2.0 - private final static String DATASET_A = "http://projekt-opal.de/dataset/https___europeandataportal_eu_set_data_informatii_financiare"; - // Distribution has license - // https://www.europeandataportal.eu/content/show-license?license_id=OGL2.0 - private final static String DATASET_B = "http://projekt-opal.de/dataset/https___europeandataportal_eu_set_data_lista_tuturor_institutiilor_2018"; - - private static final Logger LOGGER = LogManager.getLogger(); - - public static void main(String[] args) throws IOException { - - DatasetExtractor datasetExtractor = new DatasetExtractor(); - - // Print catalogs - if (Boolean.TRUE.equals(false)) - System.out.println(datasetExtractor.getCatalogs()); - - // Print model filtered by license - if (Boolean.TRUE.equals(false)) - RDFDataMgr.write(System.out, datasetExtractor.getDatasetsByLicense(DatasetExtractor.URI_OGL_B), - Lang.TURTLE); - - // Print dataset for tests - if (Boolean.TRUE.equals(false)) - RDFDataMgr.write(System.out, datasetExtractor.getDataset(DatasetExtractor.DATASET_B), Lang.TURTLE); - } - - private Model getDataset(String datasetUri) throws IOException { - LOGGER.info("getDataset"); - String query = getQuery("dataset").replace("?dataset", "<" + datasetUri + ">"); - return execConstruct(query); - } - - private Model getDatasetsByLicense(String license) throws IOException { - LOGGER.info("getDatasetsByLicense"); - String query = getQuery("datasets-by-license").replace("?license", "<" + license + ">"); - return execConstruct(query); - } - - private List getCatalogs() throws IOException { - LOGGER.info("getCatalogs"); - List list = new LinkedList(); - ResultSet resultSet = execSelect(getQuery("catalogs")); - while (resultSet.hasNext()) { - list.add(resultSet.next().getResource("catalog").toString()); - } - return list; - } - - /** - * Executes CONSTRUCT query on endpoint. - */ - private Model execConstruct(String query) { - LOGGER.info("Construct on " + ENDPOINT); - QueryExecution queryExecution = QueryExecutionFactory.sparqlService(ENDPOINT, query); - return queryExecution.execConstruct(); - } - - /** - * Executes SELECT query on endpoint. - */ - private ResultSet execSelect(String query) { - LOGGER.info("Select on " + ENDPOINT); - QueryExecution queryExecution = QueryExecutionFactory.sparqlService(ENDPOINT, query); - return queryExecution.execSelect(); - } - - /** - * Gets query from file. - */ - private String getQuery(String id) throws IOException { - File file = new File("src/test/resources/org/dice_research/opal/licenses/queries/" + id + ".txt"); - return FileUtils.readFileToString(file, StandardCharsets.UTF_8); - } - -} \ No newline at end of file diff --git a/src/test/java/org/dice_research/opal/licenses/LicensesTest.java b/src/test/java/org/dice_research/opal/licenses/LicensesTest.java deleted file mode 100644 index 1f6a6e6..0000000 --- a/src/test/java/org/dice_research/opal/licenses/LicensesTest.java +++ /dev/null @@ -1,339 +0,0 @@ -package org.dice_research.opal.licenses; - -import java.util.Collection; -import java.util.HashMap; -import java.util.HashSet; -import java.util.Iterator; -import java.util.LinkedList; -import java.util.List; -import java.util.Set; -import java.util.stream.Collectors; - -import org.apache.jena.graph.Triple; -import org.apache.jena.rdf.model.Model; -import org.apache.jena.rdf.model.ModelFactory; -import org.apache.jena.rdf.model.Property; -import org.apache.jena.rdf.model.Resource; -import org.apache.jena.rdf.model.ResourceFactory; -import org.apache.jena.rdf.model.Statement; -import org.apache.jena.rdf.model.StmtIterator; -import org.dice_research.opal.licenses.old.Constants; -import org.dice_research.opal.licenses.old.LicenseAttribute; -import org.dice_research.opal.licenses.old.LicenseCombinator; -import org.dice_research.opal.licenses.old.cleaning.JavaApi; -import org.dice_research.opal.licenses.old.cleaning.LicensePatterns; -import org.junit.Assert; -import org.junit.Assume; -import org.junit.Test; - -public class LicensesTest { - - public static final HashMap cc0attrs; - - static { - cc0attrs = new HashMap<>(); - cc0attrs.put(LicenseAttribute.Permission.REPRODUCTION, true); - cc0attrs.put(LicenseAttribute.Permission.DISTRIBUTION, true); - cc0attrs.put(LicenseAttribute.Permission.DERIVATIVE, true); - cc0attrs.put(LicenseAttribute.Permission.SUBLICENSING, true); - cc0attrs.put(LicenseAttribute.Permission.PATENTGRANT, false); - cc0attrs.put(LicenseAttribute.Requirement.NOTICE, false); - cc0attrs.put(LicenseAttribute.Requirement.ATTRIBUTION, false); - cc0attrs.put(LicenseAttribute.Requirement.SHAREALIKE, false); - cc0attrs.put(LicenseAttribute.Requirement.COPYLEFT, false); - cc0attrs.put(LicenseAttribute.Requirement.LESSERCOPYLEFT, false); - cc0attrs.put(LicenseAttribute.Requirement.STATECHANGES, false); - cc0attrs.put(LicenseAttribute.Prohibition.COMMERCIAL, false); - cc0attrs.put(LicenseAttribute.Prohibition.USETRADEMARK, false); - } - - /** - * Dummy tests providing examples. - * - * TODO: Test implementation. - */ - @Test - public void test() throws Exception { - - Model inputModel = ModelFactory.createDefaultModel(); - Resource resourceA = ResourceFactory.createResource("http://example.org/resA"); - Resource resourceB = ResourceFactory.createResource("http://example.org/resB"); - Property property = ResourceFactory.createProperty("http://example.org/prop"); - inputModel.add(resourceA, property, resourceB); - - JavaApi javaApi = new JavaApi(); - Model outputModel = javaApi.process(inputModel, null); - - // Dummy test: Both models should have the same size - Assert.assertEquals("Same size", inputModel.size(), outputModel.size()); - - // Dummy test: Both models should not have the same size - Assert.assertNotEquals("Different size", inputModel.size(), - javaApi.process(ModelFactory.createDefaultModel(), null).size()); - - // Dummy test: Exception expected - boolean exceptionThrown = false; - try { - javaApi.process(null, null); - } catch (Exception e) { - // Exception expected - exceptionThrown = true; - } - if (!exceptionThrown) { - throw new AssertionError("Model size error."); - } - } - - /** - * Dummy tests with example datasets. - * - * TODO: Test implementation. - */ - @Test - public void testOdcIntegration() throws Exception { - // Read test datasets - Model datasetModelA = TestUtils.getDatasetAsModel("odc-a"); - Model datasetModelB = TestUtils.getDatasetAsModel("odc-b"); - - // Process datasets - JavaApi javaApi = new JavaApi(); - // TODO: Exception is thrown - // Model datasetModelAProcessed = javaApi.process(datasetModelA, null); - // Model datasetModelBProcessed = javaApi.process(datasetModelB, null); - - // Test (dummy) - // Assert.assertEquals(datasetModelA.size(), datasetModelAProcessed.size()); - // Assert.assertEquals(datasetModelB.size(), datasetModelBProcessed.size()); - } - - public int countLicensesInModel(Model m) { - Set licenses = new HashSet<>(); - - StmtIterator stmts = m.listStatements(); - - while (stmts.hasNext()) { - Statement stmt = stmts.next(); - Triple t = stmt.asTriple(); - - if (Constants.DCT_LICENSE.equals(t.getPredicate().toString())) - licenses.add(t.getObject().toString()); - } - - /* - * System.out.print("Licenses: "); for (String s : licenses) { - * System.out.print(s + " "); } System.out.println(); - */ - - return licenses.size(); - } - - /** - * Test unifying of licenses. - * - * ModelA contains - * `http://europeandataportal.eu/content/show-license?license_id=OGL2.0` ModelB - * contains - * `https://www.europeandataportal.eu/content/show-license?license_id=OGL2.0` - * - * The test generates a merged model, processes it and counts the unique license - * URIs. - * - * TODO: {@link LicensePatterns#getModel()} has to provide ttl. - */ - @Test(expected = ExceptionInInitializerError.class) - public void testLicenseUnification() throws Exception { - - // TODO: {@link LicensePatterns#getModel()} has to provide ttl. - boolean noException = true; - try { - LicensePatterns.getModel(); - } catch (Exception e2) { - noException = false; - } - Assume.assumeTrue(noException); - - // Read test datasets - Model datasetModelA = TestUtils.getDatasetAsModel("odc-a"); - Model datasetModelB = TestUtils.getDatasetAsModel("odc-b"); - - Model merged = ModelFactory.createDefaultModel(); - merged.add(datasetModelA); - merged.add(datasetModelB); - - // Process datasets - JavaApi javaApi = new JavaApi(); - Model processed = javaApi.process(merged); - - Assert.assertEquals(countLicensesInModel(merged), 2); - Assert.assertEquals(countLicensesInModel(processed), 1); - } - - private void printList(List objs) { - System.out.print("["); - - Iterator it = objs.iterator(); - - while (it.hasNext()) { - System.out.print(it.next().toString()); - if (it.hasNext()) - System.out.print(", "); - } - - System.out.println("]"); - } - - /** - * Test license combinations. - */ - @Test - public void testLicenseCombinator() throws Exception { - Collection cc0 = new LinkedList(); - cc0.add("https://creativecommons.org/publicdomain/zero/1.0/legalcode"); - - Collection ccbynd40 = new LinkedList(); - ccbynd40.addAll(cc0); - ccbynd40.add("http://creativecommons.org/licenses/by-nd/4.0/legalcode"); - - LicenseCombinator lc = new LicenseCombinator(); - - Collection expectedLicenses = new LinkedList<>(); - expectedLicenses.add("https://www.govdata.de/dl-de/by-2-0"); - - Assert.assertEquals(expectedLicenses, lc.getLicenseSuggestions(ccbynd40)); - - List cc0Suggestions = lc.getLicenseSuggestions(cc0); - - Assert.assertEquals("List doesn't start with input license", - "https://creativecommons.org/publicdomain/zero/1.0/legalcode", cc0Suggestions.get(0)); - - expectedLicenses = new HashSet<>(); - expectedLicenses.add("https://creativecommons.org/publicdomain/zero/1.0/legalcode"); - expectedLicenses.add("http://www.nationalarchives.gov.uk/doc/open-government-licence/version/3/"); - expectedLicenses.add("http://www.nationalarchives.gov.uk/doc/open-government-licence/version/1/"); - expectedLicenses.add("https://www.govdata.de/dl-de/by-2-0"); - expectedLicenses.add("https://www.govdata.de/dl-de/by-1-0"); - expectedLicenses.add("http://data.gov.ro/base/images/logoinst/OGL-ROU-1.0.pdf"); - expectedLicenses.add("https://joinup.ec.europa.eu/software/page/eupl/licence-eupl"); - expectedLicenses.add("https://www.govdata.de/dl-de/zero-2-0"); - expectedLicenses.add("https://www.govdata.de/dl-de/by-nc-1-0"); - expectedLicenses.add("http://www.nationalarchives.gov.uk/doc/open-government-licence/version/2/"); - expectedLicenses.add("http://opendatacommons.org/licenses/pddl/1-0/"); - expectedLicenses.add( - "http://www.nationalarchives.gov.uk/doc/non-commercial-government-licence/non-commercial-government-licence.htm"); - - // test remaining data order-independent - Set cc0SuggSet = new HashSet(cc0Suggestions); - Assert.assertEquals(expectedLicenses, cc0SuggSet); - } - - /** - * Test license attributes - * - * Tests if by giving a single license(no combination computation performed) we - * get the exact attributes of this license - */ - @Test - public void testLicenseAttributes0() throws Exception { - LicenseCombinator lc = new LicenseCombinator(); - - Collection cc0 = new LinkedList(); - cc0.add("https://creativecommons.org/publicdomain/zero/1.0/legalcode"); - - Assert.assertEquals(lc.getLicenseAttributes(cc0), cc0attrs); - } - - /** - * Test license attributes - * - * Tests if by combining two licenses, we get the smallest denominator attribute - * set. - */ - @Test - public void testLicenseAttributes1() throws Exception { - LicenseCombinator lc = new LicenseCombinator(); - - Collection ccbynd40 = new LinkedList(); - ccbynd40.add("https://creativecommons.org/publicdomain/zero/1.0/legalcode"); - ccbynd40.add("http://creativecommons.org/licenses/by-nd/4.0/legalcode"); - - HashMap combination = new HashMap<>(); - combination.put(LicenseAttribute.Permission.REPRODUCTION, true); - combination.put(LicenseAttribute.Permission.DISTRIBUTION, true); - combination.put(LicenseAttribute.Permission.DERIVATIVE, false); - combination.put(LicenseAttribute.Permission.SUBLICENSING, false); - combination.put(LicenseAttribute.Permission.PATENTGRANT, false); - combination.put(LicenseAttribute.Requirement.NOTICE, true); - combination.put(LicenseAttribute.Requirement.ATTRIBUTION, true); - combination.put(LicenseAttribute.Requirement.SHAREALIKE, false); - combination.put(LicenseAttribute.Requirement.COPYLEFT, false); - combination.put(LicenseAttribute.Requirement.LESSERCOPYLEFT, false); - combination.put(LicenseAttribute.Requirement.STATECHANGES, true); - combination.put(LicenseAttribute.Prohibition.COMMERCIAL, false); - combination.put(LicenseAttribute.Prohibition.USETRADEMARK, false); - - Assert.assertEquals(lc.getLicenseAttributes(ccbynd40), combination); - } - - /** - * Tests getting a license compatible to a given attribute set - */ - @Test - public void testGetLicenseFromAttributes() throws Exception { - LicenseCombinator lc = new LicenseCombinator(); - - List cc0 = new LinkedList(); - cc0.add("https://creativecommons.org/publicdomain/zero/1.0/legalcode"); - - Set licensesFromAttributes = new HashSet<>(lc.getLicenseFromAttributes(cc0attrs)); - Set expectedURIs = new HashSet<>(lc.getLicenseSuggestions(cc0)); - - Assert.assertEquals(licensesFromAttributes, expectedURIs); - } - - @Test - public void testGetLicenseSuggestionsFromModels() throws Exception { - Model m0 = ModelFactory.createDefaultModel(); - Model m1 = ModelFactory.createDefaultModel(); - - /* ### Build models ### */ - - Resource s, o; - Property p; - - s = m0.createResource("file:///resource0"); - p = m0.createProperty(Constants.DCT_LICENSE); - - o = m0.createResource("https://creativecommons.org/publicdomain/zero/1.0/legalcode"); - m0.add(s, p, o); - - o = m0.createResource("http://creativecommons.org/licenses/by-nc-nd/4.0/legalcode"); - m0.add(s, p, o); - - s = m1.createResource("file:///resource1"); - p = m1.createProperty(Constants.DCT_LICENSE); - - o = m1.createResource("http://creativecommons.org/licenses/by-nd/4.0/legalcode"); - m1.add(s, p, o); - o = m1.createResource("http://creativecommons.org/licenses/by-nc-nd/4.0/legalcode"); - m1.add(s, p, o); - - /* ### Real testing ### */ - - LicenseCombinator lc = new LicenseCombinator(); - - Set> suggestions = lc.getLicenseSuggestions(m0, m1).stream().map(list -> new HashSet<>(list)) - .collect(Collectors.toSet()); - - Set suggestion = new HashSet<>(); - suggestion.add("https://www.govdata.de/dl-de/by-2-0"); - - Assert.assertTrue(suggestions.contains(suggestion)); - - suggestion.clear(); - suggestion.add("http://creativecommons.org/licenses/by-nc-nd/4.0/legalcode"); - suggestion.add("http://creativecommons.org/licenses/by-nc/4.0/legalcode"); - suggestion.add("http://creativecommons.org/licenses/by-nc-sa/4.0/legalcode"); - - Assert.assertTrue(suggestions.contains(suggestion)); - } -} \ No newline at end of file diff --git a/src/test/java/org/dice_research/opal/licenses/example/Example.java b/src/test/java/org/dice_research/opal/licenses/example/Example.java deleted file mode 100644 index 6b7b60b..0000000 --- a/src/test/java/org/dice_research/opal/licenses/example/Example.java +++ /dev/null @@ -1,43 +0,0 @@ -package org.dice_research.opal.licenses.example; - -import java.util.Collection; -import java.util.HashMap; -import java.util.LinkedList; -import java.util.Map; - -import org.dice_research.opal.licenses.old.LicenseAttribute; -import org.dice_research.opal.licenses.old.LicenseCombinator; -import org.dice_research.opal.licenses.old.LicenseCombinatorInterface; -import org.dice_research.opal.licenses.old.exceptions.UnknownLicenseException; - - -public class Example { - - LicenseCombinatorInterface lc = new LicenseCombinator(); - - public void combineLicenses() throws UnknownLicenseException { - // Put some license-URIs in a collection - Collection licenses = new LinkedList<>(); - licenses.add("https://creativecommons.org/publicdomain/zero/1.0/legalcode"); - licenses.add("http://creativecommons.org/licenses/by-nd/4.0/legalcode"); - - // Yields a list containing only "https://www.govdata.de/dl-de/by-2-0" - lc.getLicenseSuggestions(licenses); - } - - /** - * Search for licenses with specific attributes - */ - public void licenseFromAttributes() { - - // create attribute map - Map attributes = new HashMap<>(); - - // add some attributes - attributes.put(LicenseAttribute.Permission.DERIVATIVE, true); - attributes.put(LicenseAttribute.Permission.SUBLICENSING, true); - - // Yields 12 different licenses which all allow derivative works and sublicensing - lc.getLicenseFromAttributes(attributes); - } -} diff --git a/src/test/resources/org/dice_research/opal/licenses/datasets/odc-a.ttl b/src/test/resources/org/dice_research/opal/licenses/datasets/odc-a.ttl deleted file mode 100644 index f169cbc..0000000 --- a/src/test/resources/org/dice_research/opal/licenses/datasets/odc-a.ttl +++ /dev/null @@ -1,518 +0,0 @@ -@prefix ns6: . -@prefix ns5: . -@prefix ns8: . -@prefix ns7: . -@prefix ns9: . -@prefix rdf: . -@prefix xsd: . -@prefix skos: . -@prefix ns2: . -@prefix foaf: . -@prefix ns4: . -@prefix ns3: . - -ns5:https___europeandataportal_eu_set_distribution_aa79cb53_8b40_4b34_babe_f05a5bf1db2d - a ns4:Distribution ; - ns2:description ""@ro ; - ns2:format ns8:XLS ; - ns2:license ; - ns2:title "Payments activity curenta- July 2016"@ro ; - ns4:accessURL . - -ns5:https___europeandataportal_eu_set_distribution_5e5a2e21_5791_41bf_a6c7_126904177dc9 - a ns4:Distribution ; - ns2:description "CATEGORIES: Expenditure (Goods and services/Projects with external finanatare neramburasabile/Own resources/INFORMATION: Amount paid/Beneficiary/Objective/Date of payment "@ro ; - ns2:format ns8:XLS ; - ns2:license ; - ns2:title "Current payments activity — February 2014"@ro ; - ns4:accessURL . - -ns7:measurement1015807 - a ns6:qualityMeasurement ; - ns6:isMeasurementOf ns9:ContactUrl , ns9:Categorization ; - ns6:value "0.0"^^xsd:float . - -ns5:https___europeandataportal_eu_set_distribution_bbbf4d50_4cd8_4bac_91fd_424b29739f70 - a ns4:Distribution ; - ns2:description ""@ro ; - ns2:format ns8:XLS ; - ns2:license ; - ns2:title "Payments activity curenta-August 2016"@ro ; - ns4:accessURL . - -ns5:https___europeandataportal_eu_set_distribution_8fb077db_a807_4e61_9f0d_a7b3ad3a74a0 - a ns4:Distribution ; - ns2:description ""@ro ; - ns2:format ns8:XLS ; - ns2:license ; - ns2:title "Payments activity curenta- May 2016"@ro ; - ns4:accessURL . - -ns5:https___europeandataportal_eu_set_distribution_3383e541_7f6d_436b_947a_0637244a0303 - a ns4:Distribution ; - ns2:description ""@ro ; - ns2:format ns8:XLS ; - ns2:license ; - ns2:title "Payments activity curenta-December 2012"@ro ; - ns4:accessURL . - -ns5:https___europeandataportal_eu_set_distribution_f9dd84f6_bc8d_4184_8e66_4f8ba0e93d2c - a ns4:Distribution ; - ns2:description ""@ro ; - ns2:format ns8:XLS ; - ns2:license ; - ns2:title "Payments activity, February 2013"@ro ; - ns4:accessURL . - -ns5:https___europeandataportal_eu_set_distribution_9ec1ea44_ea34_4435_879c_98a585908ee2 - a ns4:Distribution ; - ns2:description ""@ro ; - ns2:format ns8:XLS ; - ns2:license ; - ns2:title "Payments activity, September 2013"@ro ; - ns4:accessURL . - -ns5:https___europeandataportal_eu_set_distribution_a1d0b67c_bcca_4403_95aa_2b59ab109103 - a ns4:Distribution ; - ns2:description "CATEGORIES: Expenditure (Goods and services/Projects with external finanatare neramburasabile/Own resources/INFORMATION: Amount paid/Beneficiary/Objective/Date of payment "@ro ; - ns2:format ns8:XLS ; - ns2:license ; - ns2:title "Payments activity — January 2014"@ro ; - ns4:accessURL . - -ns5:https___europeandataportal_eu_set_distribution_9b05f30e_3a24_46ad_a010_ccc8fc571747 - a ns4:Distribution ; - ns2:description "CATEGORIES: Expenditure (Goods and services/Projects with external finanatare neramburasabile/Own resources/INFORMATION: Amount paid/Beneficiary/Objective/Date of payment "@ro ; - ns2:format ns8:XLS ; - ns2:license ; - ns2:title "Payments activity — March 2014"@ro ; - ns4:accessURL . - -ns5:https___europeandataportal_eu_set_distribution_dbce475d_337e_4913_9b95_7f3a31ab2e68 - a ns4:Distribution ; - ns2:description ""@ro ; - ns2:format ns8:XLS ; - ns2:license ; - ns2:title "Payments activity, April 2013"@ro ; - ns4:accessURL . - -ns5:https___europeandataportal_eu_set_distribution_4bbe3fa4_f49c_426d_b3ef_2fe842560562 - a ns4:Distribution ; - ns2:description ""@ro ; - ns2:format ns8:XLS ; - ns2:license ; - ns2:title "Current payments activity — April 2015"@ro ; - ns4:accessURL . - -ns5:https___europeandataportal_eu_set_distribution_0e020b6c_02f5_42c8_a043_48106c2bbe7c - a ns4:Distribution ; - ns2:description ""@ro ; - ns2:format ns8:XLS ; - ns2:license ; - ns2:title "Payments activity — November 2014"@ro ; - ns4:accessURL . - -ns5:https___europeandataportal_eu_set_distribution_ee5bc023_2a0b_4fda_8758_fc8cda6bf69b - a ns4:Distribution ; - ns2:description ""@ro ; - ns2:format ns8:XLS ; - ns2:license ; - ns2:title "Current payments activity — June 2014"@ro ; - ns4:accessURL . - -ns5:https___europeandataportal_eu_set_distribution_d3781700_7c77_4a22_83d8_1f4e4a0e12fe - a ns4:Distribution ; - ns2:description ""@ro ; - ns2:format ns8:XLS ; - ns2:license ; - ns2:title "Payments activity — March 2015"@ro ; - ns4:accessURL . - -ns5:https___europeandataportal_eu_set_distribution_6143e093_c509_47e6_a398_8eb7e60b105c - a ns4:Distribution ; - ns2:description ""@ro ; - ns2:format ns8:XLS ; - ns2:license ; - ns2:title "Payments activity curenta-March 2016"@ro ; - ns4:accessURL . - -ns7:measurement1015806 - a ns6:qualityMeasurement ; - ns6:isMeasurementOf ns9:KnownLicense ; - ns6:value "5.0"^^xsd:float , "0.0"^^xsd:float . - -ns5:https___europeandataportal_eu_set_distribution_51ed7dea_acc4_4512_99c1_ab798f613568 - a ns4:Distribution ; - ns2:description ""@ro ; - ns2:format ns8:XLS ; - ns2:license ; - ns2:title "Payments activity — March 2013"@ro ; - ns4:accessURL . - -ns5:https___europeandataportal_eu_set_distribution_ed9e80da_5838_4c47_8ebb_5724786b6987 - a ns4:Distribution ; - ns2:description ""@ro ; - ns2:format ns8:XLS ; - ns2:license ; - ns2:title "Current payments activity — July 2015"@ro ; - ns4:accessURL . - - - a foaf:Document . - -ns5:https___europeandataportal_eu_set_distribution_7628b4af_11ff_483d_88b6_1340d957f17f - a ns4:Distribution ; - ns2:description ""@ro ; - ns2:format ns8:XLS ; - ns2:license ; - ns2:title "Payments activity — July 2013"@ro ; - ns4:accessURL . - -ns5:https___europeandataportal_eu_set_distribution_09da285e_46a0_40b7_8859_8264a3c93d21 - a ns4:Distribution ; - ns2:description ""@ro ; - ns2:format ns8:XLS ; - ns2:license ; - ns2:title "Payments activity — September 2015"@ro ; - ns4:accessURL . - -ns5:https___europeandataportal_eu_set_distribution_74ea36bd_11be_4ca1_978e_b5e25bdcb92f - a ns4:Distribution ; - ns2:description ""@ro ; - ns2:format ns8:XLS ; - ns2:license ; - ns2:title "Current payments activity — June 2015"@ro ; - ns4:accessURL . - -ns5:https___europeandataportal_eu_set_distribution_b96d6eae_8a04_44a3_8de9_d551536c2568 - a ns4:Distribution ; - ns2:description ""@ro ; - ns2:format ns8:XLS ; - ns2:license ; - ns2:title "Payments activity curenta-February 2012"@ro ; - ns4:accessURL . - -ns5:https___europeandataportal_eu_set_distribution_1be0abfa_4f86_4f98_86cf_d0bbb9d14697 - a ns4:Distribution ; - ns2:description ""@ro ; - ns2:format ns8:XLS ; - ns2:license ; - ns2:title "Payments activity — May 2013"@ro ; - ns4:accessURL . - -ns5:https___europeandataportal_eu_set_distribution_5fd9456b_5652_4887_94c9_2fc06ca7c04a - a ns4:Distribution ; - ns2:description ""@ro ; - ns2:format ns8:XLS ; - ns2:license ; - ns2:title "Payments activity, December 2013"@ro ; - ns4:accessURL . - -ns5:https___europeandataportal_eu_set_distribution_89a902c6_ddfe_46ca_8130_2a872964b9e6 - a ns4:Distribution ; - ns2:description ""@ro ; - ns2:format ns8:XLS ; - ns2:license ; - ns2:title "Payments activity curenta-December 2015"@ro ; - ns4:accessURL . - -ns5:https___europeandataportal_eu_set_distribution_b429f077_6a32_4e4d_875a_cce9c6c3c7fe - a ns4:Distribution ; - ns2:description ""@ro ; - ns2:format ns8:XLS ; - ns2:license ; - ns2:title "Current payments activity — January 2015"@ro ; - ns4:accessURL . - -ns5:https___europeandataportal_eu_set_distribution_04c5a6d1_b4cd_4e68_9405_a918df4e983b - a ns4:Distribution ; - ns2:description ""@ro ; - ns2:format ns8:XLS ; - ns2:license ; - ns2:title "Payments activity curenta-October 2012"@ro ; - ns4:accessURL . - -ns5:https___europeandataportal_eu_set_distribution_749e8a24_1816_47df_840e_2664437d536d - a ns4:Distribution ; - ns2:description ""@ro ; - ns2:format ns8:XLS ; - ns2:license ; - ns2:title "Payments activity curenta-November 2015"@ro ; - ns4:accessURL . - -ns5:https___europeandataportal_eu_set_distribution_001d4786_95c6_4fff_8943_a514b93633be - a ns4:Distribution ; - ns2:description ""@ro ; - ns2:format ns8:XLS ; - ns2:license ; - ns2:title "Payments activity — August 2013"@ro ; - ns4:accessURL . - -ns5:https___europeandataportal_eu_set_distribution_bb3627de_a966_4561_a1d1_f5f9acfe2ee9 - a ns4:Distribution ; - ns2:description ""@ro ; - ns2:format ns8:XLS ; - ns2:license ; - ns2:title "Payments activity curenta-March 2012"@ro ; - ns4:accessURL . - -ns5:https___europeandataportal_eu_set_distribution_20d90e4d_9557_4a31_89e2_d3decca976ee - a ns4:Distribution ; - ns2:description ""@ro ; - ns2:format ns8:XLS ; - ns2:license ; - ns2:title "Payments activity curenta-April 2016"@ro ; - ns4:accessURL . - -ns5:https___europeandataportal_eu_set_distribution_c288916e_542d_4cb9_a1f6_d92391597b63 - a ns4:Distribution ; - ns2:description ""@ro ; - ns2:format ns8:XLS ; - ns2:license ; - ns2:title "Current payments activity — September 2014"@ro ; - ns4:accessURL . - -ns5:https___europeandataportal_eu_set_distribution_2dc48697_bbfa_4727_8f2c_a1005838d178 - a ns4:Distribution ; - ns2:description ""@ro ; - ns2:format ns8:XLS ; - ns2:license ; - ns2:title "Payments activity curenta-January 2016"@ro ; - ns4:accessURL . - -ns5:https___europeandataportal_eu_set_distribution_b1b607f8_8ed7_486d_8d16_a036d0d2463f - a ns4:Distribution ; - ns2:description ""@ro ; - ns2:format ns8:XLS ; - ns2:license ; - ns2:title "Payments activity curenta-November 2012"@ro ; - ns4:accessURL . - -ns5:https___europeandataportal_eu_set_distribution_9cd72f8c_adbe_4dfe_a30a_7980f90fabb9 - a ns4:Distribution ; - ns2:description ""@ro ; - ns2:format ns8:XLS ; - ns2:license ; - ns2:title "Payments activity — February 2015"@ro ; - ns4:accessURL . - -ns5:https___europeandataportal_eu_set_distribution_3844bd30_1d1d_4eab_acc4_1188d923785b - a ns4:Distribution ; - ns2:description ""@ro ; - ns2:format ns8:XLS ; - ns2:license ; - ns2:title "Payments activity curenta-September 2012"@ro ; - ns4:accessURL . - -ns7:measurement1015812 - a ns6:qualityMeasurement ; - ns6:isMeasurementOf ns9:LinkedDataRepresentation , ns9:Timeliness ; - ns6:value "0.0"^^xsd:float , "5.0"^^xsd:float . - -ns3:https___europeandataportal_eu_set_data_informatii_financiare - ns2:publisher [ a foaf:Agent ; - foaf:name "MDRAP" - ] ; - ns2:publisher [ a foaf:Agent ; - foaf:name "MDRAP" - ] ; - ns4:contactPoint [ ns2:type "http://www.w3.org/2006/vcard/ns#Kind"^^skos:Concept ; - foaf:name "" - ] ; - ns4:contactPoint [ ns2:type "http://www.w3.org/2006/vcard/ns#Kind"^^skos:Concept ; - foaf:name "" - ] ; - ns4:contactPoint [ ns2:type "http://www.w3.org/2006/vcard/ns#Kind"^^skos:Concept ; - foaf:name "" - ] ; - ns4:distribution ns5:https___europeandataportal_eu_set_distribution_51ed7dea_acc4_4512_99c1_ab798f613568 , ns5:https___europeandataportal_eu_set_distribution_02a8d11a_c1d1_41da_be95_99675cf1e326 , ns5:https___europeandataportal_eu_set_distribution_9372b46e_04e2_402e_81a3_f65c2f691cf8 , ns5:https___europeandataportal_eu_set_distribution_a717d3d6_6c85_4927_a620_cdcdb3efef45 , ns5:https___europeandataportal_eu_set_distribution_b96d6eae_8a04_44a3_8de9_d551536c2568 , ns5:https___europeandataportal_eu_set_distribution_dfe6ee1e_10cb_4951_a776_a1a80e009c85 , ns5:https___europeandataportal_eu_set_distribution_1be0abfa_4f86_4f98_86cf_d0bbb9d14697 , ns5:https___europeandataportal_eu_set_distribution_42c3baf1_be86_4467_9003_823d30e69fc4 , ns5:https___europeandataportal_eu_set_distribution_0e020b6c_02f5_42c8_a043_48106c2bbe7c , ns5:https___europeandataportal_eu_set_distribution_20d90e4d_9557_4a31_89e2_d3decca976ee , ns5:https___europeandataportal_eu_set_distribution_4d2491cc_01ef_4a9e_8d6f_5fc5673cbf1b , ns5:https___europeandataportal_eu_set_distribution_ed9e80da_5838_4c47_8ebb_5724786b6987 , ns5:https___europeandataportal_eu_set_distribution_c368cf10_36ff_454f_a26e_80e9d1da5490 , ns5:https___europeandataportal_eu_set_distribution_a1d0b67c_bcca_4403_95aa_2b59ab109103 , ns5:https___europeandataportal_eu_set_distribution_d7a9f660_6e38_4a4f_bc96_9122c574afe1 , ns5:https___europeandataportal_eu_set_distribution_b1b607f8_8ed7_486d_8d16_a036d0d2463f , ns5:https___europeandataportal_eu_set_distribution_8fb077db_a807_4e61_9f0d_a7b3ad3a74a0 , ns5:https___europeandataportal_eu_set_distribution_749e8a24_1816_47df_840e_2664437d536d , ns5:https___europeandataportal_eu_set_distribution_d3781700_7c77_4a22_83d8_1f4e4a0e12fe , ns5:https___europeandataportal_eu_set_distribution_7628b4af_11ff_483d_88b6_1340d957f17f , ns5:https___europeandataportal_eu_set_distribution_b429f077_6a32_4e4d_875a_cce9c6c3c7fe , ns5:https___europeandataportal_eu_set_distribution_c48c8811_5832_4476_8119_cb136131a4cb , ns5:https___europeandataportal_eu_set_distribution_9ce98d29_4887_40b9_8585_e2359bdb9c7d , ns5:https___europeandataportal_eu_set_distribution_09da285e_46a0_40b7_8859_8264a3c93d21 , ns5:https___europeandataportal_eu_set_distribution_bbbf4d50_4cd8_4bac_91fd_424b29739f70 , ns5:https___europeandataportal_eu_set_distribution_9952221a_d3fc_411a_b994_18f4d500f861 , ns5:https___europeandataportal_eu_set_distribution_89a902c6_ddfe_46ca_8130_2a872964b9e6 , ns5:https___europeandataportal_eu_set_distribution_bb3627de_a966_4561_a1d1_f5f9acfe2ee9 , ns5:https___europeandataportal_eu_set_distribution_9cd72f8c_adbe_4dfe_a30a_7980f90fabb9 , ns5:https___europeandataportal_eu_set_distribution_5fd9456b_5652_4887_94c9_2fc06ca7c04a , ns5:https___europeandataportal_eu_set_distribution_74ea36bd_11be_4ca1_978e_b5e25bdcb92f , ns5:https___europeandataportal_eu_set_distribution_2ea51bd1_6869_418b_bcf9_ad246c089d01 , ns5:https___europeandataportal_eu_set_distribution_c72937bc_fae6_4a44_9d6f_99c9b4cf5af9 , ns5:https___europeandataportal_eu_set_distribution_eb8a0cab_fd46_4cf0_a34d_ae2a37165c7a , ns5:https___europeandataportal_eu_set_distribution_5e5a2e21_5791_41bf_a6c7_126904177dc9 , ns5:https___europeandataportal_eu_set_distribution_9ec1ea44_ea34_4435_879c_98a585908ee2 , ns5:https___europeandataportal_eu_set_distribution_89752d19_0e18_48fc_b8de_3039f16ff410 , ns5:https___europeandataportal_eu_set_distribution_aa79cb53_8b40_4b34_babe_f05a5bf1db2d , ns5:https___europeandataportal_eu_set_distribution_dbce475d_337e_4913_9b95_7f3a31ab2e68 , ns5:https___europeandataportal_eu_set_distribution_6143e093_c509_47e6_a398_8eb7e60b105c , ns5:https___europeandataportal_eu_set_distribution_4bbe3fa4_f49c_426d_b3ef_2fe842560562 , ns5:https___europeandataportal_eu_set_distribution_ee5bc023_2a0b_4fda_8758_fc8cda6bf69b , ns5:https___europeandataportal_eu_set_distribution_04c5a6d1_b4cd_4e68_9405_a918df4e983b , ns5:https___europeandataportal_eu_set_distribution_bdc057d8_37c3_4a10_864a_002917cec6ac , ns5:https___europeandataportal_eu_set_distribution_9b05f30e_3a24_46ad_a010_ccc8fc571747 , ns5:https___europeandataportal_eu_set_distribution_001d4786_95c6_4fff_8943_a514b93633be , ns5:https___europeandataportal_eu_set_distribution_2dc48697_bbfa_4727_8f2c_a1005838d178 , ns5:https___europeandataportal_eu_set_distribution_0f733cbc_e572_404d_9fb5_dc4628099d7b , ns5:https___europeandataportal_eu_set_distribution_ac56642a_4663_4f5b_b2a5_0977210f981e , ns5:https___europeandataportal_eu_set_distribution_8bf5628f_2210_4cc5_a366_01e103be153b , ns5:https___europeandataportal_eu_set_distribution_f9dd84f6_bc8d_4184_8e66_4f8ba0e93d2c , ns5:https___europeandataportal_eu_set_distribution_3383e541_7f6d_436b_947a_0637244a0303 , ns5:https___europeandataportal_eu_set_distribution_276ab8bf_eef4_4853_9199_38b22088299e , ns5:https___europeandataportal_eu_set_distribution_3844bd30_1d1d_4eab_acc4_1188d923785b , ns5:https___europeandataportal_eu_set_distribution_c288916e_542d_4cb9_a1f6_d92391597b63 , ns5:https___europeandataportal_eu_set_distribution_8f106f8f_ce8d_4877_ace0_91da6ab94781 ; - ns6:hasQualityMeasurement ns7:measurement1015809 , ns7:measurement1015810 , ns7:measurement1015811 , ns7:measurement1015806 , ns7:measurement1015812 , ns7:measurement1015807 , ns7:measurement1015808 ; - foaf:page . - -ns5:https___europeandataportal_eu_set_distribution_c72937bc_fae6_4a44_9d6f_99c9b4cf5af9 - a ns4:Distribution ; - ns2:description ""@ro ; - ns2:format ns8:XLS ; - ns2:license ; - ns2:title "Payments activity — October 2014"@ro ; - ns4:accessURL . - -ns5:https___europeandataportal_eu_set_distribution_0f733cbc_e572_404d_9fb5_dc4628099d7b - a ns4:Distribution ; - ns2:description ""@ro ; - ns2:format ns8:XLS ; - ns2:license ; - ns2:title "Payments activity, June 2013"@ro ; - ns4:accessURL . - -ns5:https___europeandataportal_eu_set_distribution_c48c8811_5832_4476_8119_cb136131a4cb - a ns4:Distribution ; - ns2:description ""@ro ; - ns2:format ns8:XLS ; - ns2:license ; - ns2:title "Payments activity curenta-April 2014"@ro ; - ns4:accessURL . - -ns5:https___europeandataportal_eu_set_distribution_2ea51bd1_6869_418b_bcf9_ad246c089d01 - a ns4:Distribution ; - ns2:description ""@ro ; - ns2:format ns8:XLS ; - ns2:license ; - ns2:title "Payments activity curenta- June 2016"@ro ; - ns4:accessURL . - -ns5:https___europeandataportal_eu_set_distribution_8bf5628f_2210_4cc5_a366_01e103be153b - a ns4:Distribution ; - ns2:description ""@ro ; - ns2:format ns8:XLS ; - ns2:license ; - ns2:title "Payments activity curenta-May 2014"@ro ; - ns4:accessURL . - -ns5:https___europeandataportal_eu_set_distribution_9952221a_d3fc_411a_b994_18f4d500f861 - a ns4:Distribution ; - ns2:description ""@ro ; - ns2:format ns8:XLS ; - ns2:license ; - ns2:title "Payments activity, January 2013"@ro ; - ns4:accessURL . - -ns5:https___europeandataportal_eu_set_distribution_276ab8bf_eef4_4853_9199_38b22088299e - a ns4:Distribution ; - ns2:description ""@ro ; - ns2:format ns8:XLS ; - ns2:license ; - ns2:title "Payments activity — November 2013"@ro ; - ns4:accessURL . - -ns5:https___europeandataportal_eu_set_distribution_dfe6ee1e_10cb_4951_a776_a1a80e009c85 - a ns4:Distribution ; - ns2:description ""@ro ; - ns2:format ns8:XLS ; - ns2:license ; - ns2:title "Payments activity — October 2013"@ro ; - ns4:accessURL . - -ns5:https___europeandataportal_eu_set_distribution_bdc057d8_37c3_4a10_864a_002917cec6ac - a ns4:Distribution ; - ns2:description ""@ro ; - ns2:format ns8:XLS ; - ns2:license ; - ns2:title "Payments activity curenta-April 2012"@ro ; - ns4:accessURL . - -ns5:https___europeandataportal_eu_set_distribution_89752d19_0e18_48fc_b8de_3039f16ff410 - a ns4:Distribution ; - ns2:description ""@ro ; - ns2:format ns8:XLS ; - ns2:license ; - ns2:title "Payments activity curenta-July 2012"@ro ; - ns4:accessURL . - -ns7:measurement1015811 - a ns6:qualityMeasurement ; - ns6:isMeasurementOf ns9:MultipleSerializations ; - ns6:value "1.0"^^xsd:float . - -ns5:https___europeandataportal_eu_set_distribution_4d2491cc_01ef_4a9e_8d6f_5fc5673cbf1b - a ns4:Distribution ; - ns2:description ""@ro ; - ns2:format ns8:XLS ; - ns2:license ; - ns2:title "Payments activity curenta-June 2012"@ro ; - ns4:accessURL . - -ns5:https___europeandataportal_eu_set_distribution_ac56642a_4663_4f5b_b2a5_0977210f981e - a ns4:Distribution ; - ns2:description ""@ro ; - ns2:format ns8:XLS ; - ns2:license ; - ns2:title "Payments activity curenta-May 2012"@ro ; - ns4:accessURL . - -ns7:measurement1015809 - a ns6:qualityMeasurement ; - ns6:isMeasurementOf ns9:Timeliness , ns9:Description ; - ns6:value "5.0"^^xsd:float , "0.0"^^xsd:float . - -ns5:https___europeandataportal_eu_set_distribution_42c3baf1_be86_4467_9003_823d30e69fc4 - a ns4:Distribution ; - ns2:description ""@ro ; - ns2:format ns8:XLS ; - ns2:license ; - ns2:title "Payments activity — July 2014"@ro ; - ns4:accessURL . - -ns5:https___europeandataportal_eu_set_distribution_a717d3d6_6c85_4927_a620_cdcdb3efef45 - a ns4:Distribution ; - ns2:description ""@ro ; - ns2:format ns8:XLS ; - ns2:license ; - ns2:title "Current payments activity — December 2014"@ro ; - ns4:accessURL . - -ns5:https___europeandataportal_eu_set_distribution_8f106f8f_ce8d_4877_ace0_91da6ab94781 - a ns4:Distribution ; - ns2:description ""@ro ; - ns2:format ns8:XLS ; - ns2:license ; - ns2:title "Payments activity curenta-August 2012"@ro ; - ns4:accessURL . - -ns5:https___europeandataportal_eu_set_distribution_9372b46e_04e2_402e_81a3_f65c2f691cf8 - a ns4:Distribution ; - ns2:description "The amount paid, beneficiary, purpose, date"@ro ; - ns2:format ns8:XLS ; - ns2:license ; - ns2:title "Payments activity curenta-February 2016"@ro ; - ns4:accessURL . - -ns5:https___europeandataportal_eu_set_distribution_c368cf10_36ff_454f_a26e_80e9d1da5490 - a ns4:Distribution ; - ns2:description ""@ro ; - ns2:format ns8:XLS ; - ns2:license ; - ns2:title "Current payments activity — August 2015"@ro ; - ns4:accessURL . - -ns5:https___europeandataportal_eu_set_distribution_d7a9f660_6e38_4a4f_bc96_9122c574afe1 - a ns4:Distribution ; - ns2:description ""@ro ; - ns2:format ns8:XLS ; - ns2:license ; - ns2:title "Current payments activity — August 2014"@ro ; - ns4:accessURL . - -ns7:measurement1015810 - a ns6:qualityMeasurement ; - ns6:isMeasurementOf ns9:Categorization , ns9:Description ; - ns6:value "5.0"^^xsd:float , "0.0"^^xsd:float . - -ns7:measurement1015808 - a ns6:qualityMeasurement ; - ns6:isMeasurementOf ns9:ContactUrl , ns9:LinkedDataRepresentation ; - ns6:value "5.0"^^xsd:float , "0.0"^^xsd:float . - -ns5:https___europeandataportal_eu_set_distribution_9ce98d29_4887_40b9_8585_e2359bdb9c7d - a ns4:Distribution ; - ns2:description ""@ro ; - ns2:format ns8:XLS ; - ns2:license ; - ns2:title "Payments activity curenta-January 2012"@ro ; - ns4:accessURL . - -ns5:https___europeandataportal_eu_set_distribution_02a8d11a_c1d1_41da_be95_99675cf1e326 - a ns4:Distribution ; - ns2:description ""@ro ; - ns2:format ns8:XLS ; - ns2:license ; - ns2:title "Payments activity — May 2015"@ro ; - ns4:accessURL . - -ns5:https___europeandataportal_eu_set_distribution_eb8a0cab_fd46_4cf0_a34d_ae2a37165c7a - a ns4:Distribution ; - ns2:description ""@ro ; - ns2:format ns8:XLS ; - ns2:license ; - ns2:title "Current payments activity — October 2015"@ro ; - ns4:accessURL . diff --git a/src/test/resources/org/dice_research/opal/licenses/datasets/odc-b.ttl b/src/test/resources/org/dice_research/opal/licenses/datasets/odc-b.ttl deleted file mode 100644 index b93d563..0000000 --- a/src/test/resources/org/dice_research/opal/licenses/datasets/odc-b.ttl +++ /dev/null @@ -1,77 +0,0 @@ -@prefix ns5: . -@prefix ns8: . -@prefix ns7: . -@prefix rdf: . -@prefix xsd: . -@prefix skos: . -@prefix ns0: . -@prefix ns2: . -@prefix ns1: . -@prefix foaf: . -@prefix ns4: . -@prefix ns3: . - -ns5:measurement1110387 - a ns4:qualityMeasurement ; - ns4:isMeasurementOf ns8:KnownLicense ; - ns4:value "0.0"^^xsd:float , "5.0"^^xsd:float . - -ns1:https___europeandataportal_eu_set_data_lista_tuturor_institutiilor_2018 - ns0:publisher [ a foaf:Agent ; - foaf:name "" - ] ; - ns0:publisher [ a foaf:Agent ; - foaf:name "" - ] ; - ns0:publisher [ a foaf:Agent ; - foaf:name "" - ] ; - ns2:contactPoint [ ns0:type "http://www.w3.org/2006/vcard/ns#Kind"^^skos:Concept ; - foaf:name "" - ] ; - ns2:contactPoint [ ns0:type "http://www.w3.org/2006/vcard/ns#Kind"^^skos:Concept ; - foaf:name "" - ] ; - ns2:contactPoint [ ns0:type "http://www.w3.org/2006/vcard/ns#Kind"^^skos:Concept ; - foaf:name "" - ] ; - ns2:distribution ns3:https___europeandataportal_eu_set_distribution_2eabc098_ef90_44c8_9c87_fe0e25d84e51 ; - ns4:hasQualityMeasurement ns5:measurement1110388 , ns5:measurement1110384 , ns5:measurement1110389 , ns5:measurement1110385 , ns5:measurement1110387 , ns5:measurement1110383 , ns5:measurement1110386 . - -ns5:measurement1110385 - a ns4:qualityMeasurement ; - ns4:isMeasurementOf ns8:MultipleSerializations , ns8:LinkedDataRepresentation ; - ns4:value "5.0"^^xsd:float , "0.0"^^xsd:float . - -ns5:measurement1110383 - a ns4:qualityMeasurement ; - ns4:isMeasurementOf ns8:Description , ns8:ContactUrl ; - ns4:value "0.0"^^xsd:float , "5.0"^^xsd:float . - -ns5:measurement1110388 - a ns4:qualityMeasurement ; - ns4:isMeasurementOf ns8:ContactUrl , ns8:Timeliness ; - ns4:value "0.0"^^xsd:float . - -ns5:measurement1110386 - a ns4:qualityMeasurement ; - ns4:isMeasurementOf ns8:Categorization , ns8:Timeliness ; - ns4:value "0.0"^^xsd:float . - -ns3:https___europeandataportal_eu_set_distribution_2eabc098_ef90_44c8_9c87_fe0e25d84e51 - a ns2:Distribution ; - ns0:description ""@ro ; - ns0:format ns7:XLSX ; - ns0:license ; - ns0:title "List of all public institutions or authorities managing public functions and reports on their situation to the National Agency of Civil Servants in the 2018 reference period"@ro ; - ns2:accessURL . - -ns5:measurement1110384 - a ns4:qualityMeasurement ; - ns4:isMeasurementOf ns8:Description , ns8:MultipleSerializations ; - ns4:value "0.0"^^xsd:float , "5.0"^^xsd:float . - -ns5:measurement1110389 - a ns4:qualityMeasurement ; - ns4:isMeasurementOf ns8:Categorization , ns8:LinkedDataRepresentation ; - ns4:value "0.0"^^xsd:float , "5.0"^^xsd:float . diff --git a/src/test/resources/org/dice_research/opal/licenses/license-uris.txt b/src/test/resources/org/dice_research/opal/licenses/license-uris.txt deleted file mode 100644 index db0f642..0000000 --- a/src/test/resources/org/dice_research/opal/licenses/license-uris.txt +++ /dev/null @@ -1,38 +0,0 @@ -http://europeandataportal.eu/content/show-license?license_id=OGL2.0 -https://www.europeandataportal.eu/content/show-license?license_id=OGL2.0 -http://europeandataportal.eu/content/show-license?license_id=FR-LO -https://www.europeandataportal.eu/content/show-license?license_id=ODC-ODbL -http://europeandataportal.eu/content/show-license?license_id=ODC-ODbL -https://www.europeandataportal.eu/content/show-license?license_id=FR-LO -file:///content/show-license?license_id=OGL2.0 -http://www.gesetze-im-internet.de/geonutzv/index.html -https://www.govdata.de/dl-de/by-2-0 -https://creativecommons.org/licenses/by/3.0/de/ -https://creativecommons.org/publicdomain/zero/1.0/deed.de -https://creativecommons.org/licenses/by/4.0/deed.de -http://www.opendefinition.org/licenses/cc-by -http://www.stadtentwicklung.berlin.de/geoinformation/download/nutzIII.pdf -http://europeandataportal.eu/content/show-license?license_id=DL-DE-BY2.0 -https://www.govdata.de/dl-de/zero-2-0 -file:///content/show-license?license_id=FR-LO -file:///content/show-license?license_id=ODC-ODbL -file:///content/show-license?license_id=CC-BY4.0 -http://www.ioer-monitor.de/fileadmin/Dokumente/PDFs/Nutzungsbedingungen_IOER-Monitor.pdf -file:///content/show-license?license_id=DL-DE-BY2.0 -https://scihub.copernicus.eu/twiki/pub/SciHubWebPortal/TermsConditions/TC_Sentinel_Data_31072014.pdf -http://europeandataportal.eu/content/show-license?license_id=GFDL-1.3 -https://www.europeandataportal.eu/content/show-license?license_id=CC-BY4.0 -http://europeandataportal.eu/content/show-license?license_id=ODC-BY -http://europeandataportal.eu/content/show-license?license_id=CC-BY4.0 -http://opendatacommons.org/licenses/odbl/summary/ -file:///content/show-license?license_id=DL-DE-BY1.0 -file:///content/show-license?license_id=ODC-BY -http://www.opendefinition.org/licenses/cc-zero -http://www.opendefinition.org/licenses/odc-odbl -https://www.europeandataportal.eu/content/show-license?license_id=ODC-BY -file:///content/show-license?license_id=GFDL-1.3 -http://europeandataportal.eu/content/show-license?license_id=PSEUL -http://images.vbb.de/assets/downloads/file/20928.pdf -http://www.opendefinition.org/licenses/cc-by-sa -https://www.europeandataportal.eu/content/show-license?license_id=GFDL-1.3 -https://www.vrsinfo.de/fileadmin/Dateien/api/NutzervereinbarungODOS.pdf diff --git a/src/test/resources/org/dice_research/opal/licenses/queries/catalogs.txt b/src/test/resources/org/dice_research/opal/licenses/queries/catalogs.txt deleted file mode 100644 index 26c6450..0000000 --- a/src/test/resources/org/dice_research/opal/licenses/queries/catalogs.txt +++ /dev/null @@ -1,8 +0,0 @@ -PREFIX dcat: - -SELECT DISTINCT ?catalog -WHERE { - GRAPH ?g { - ?catalog a dcat:Catalog - } -} \ No newline at end of file diff --git a/src/test/resources/org/dice_research/opal/licenses/queries/dataset.txt b/src/test/resources/org/dice_research/opal/licenses/queries/dataset.txt deleted file mode 100644 index fe34b9f..0000000 --- a/src/test/resources/org/dice_research/opal/licenses/queries/dataset.txt +++ /dev/null @@ -1,9 +0,0 @@ -CONSTRUCT { - ?dataset ?p ?o . - ?o ?p2 ?o2 -} WHERE { - GRAPH ?g { - ?dataset ?p ?o . - ?o ?p2 ?o2 - } -} \ No newline at end of file diff --git a/src/test/resources/org/dice_research/opal/licenses/queries/datasets-by-license.txt b/src/test/resources/org/dice_research/opal/licenses/queries/datasets-by-license.txt deleted file mode 100644 index d906e2d..0000000 --- a/src/test/resources/org/dice_research/opal/licenses/queries/datasets-by-license.txt +++ /dev/null @@ -1,14 +0,0 @@ -PREFIX dcat: -PREFIX dct: - -CONSTRUCT { - ?dataset ?p ?o . - ?o ?p2 ?o2 -} WHERE { - GRAPH ?g { - ?dataset ?p ?o . - ?o ?p2 ?o2 . - ?dataset dcat:distribution ?distribution . - ?distribution dct:license ?license - } -} \ No newline at end of file