├── .gitignore ├── .gitmodules ├── .travis.yml ├── GREL_Processor ├── RML - Function Handler.iml ├── pom.xml ├── src │ └── main │ │ └── java │ │ └── be │ │ └── ugent │ │ └── mmlab │ │ └── rml │ │ └── grel │ │ ├── ConcreteGrelProcessor.java │ │ └── GrelVocabulary.java └── target │ └── maven-archiver │ └── pom.properties ├── README.md ├── bin └── RML-Mapper ├── pom.xml └── resources └── functions ├── .gitignore ├── EcodaloFunctions.jar ├── GrelFunctions.jar ├── GrelFunctions.java ├── GrelProcessor.java └── metadata.json /.gitignore: -------------------------------------------------------------------------------- 1 | .idea/ 2 | .project 3 | /target/ 4 | .settings/ 5 | target/ 6 | log/ 7 | /data/ 8 | *.log 9 | *.iml 10 | *.yml 11 | *.jar 12 | *.bu 13 | !resources/functions/*.jar 14 | dependency-reduced-pom.xml 15 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "RML-Processor"] 2 | path = RML-Processor 3 | url = http://git@github.com/RMLio/RML-Processor.git 4 | branch = master 5 | [submodule "RML-Model"] 6 | path = RML-Model 7 | url = http://git@github.com/RMLio/RML-Model.git 8 | branch = master 9 | [submodule "RML-ConditionsHandler"] 10 | path = RML-Condition 11 | url = http://git@github.com/RMLio/RML-Condition.git 12 | branch = master 13 | [submodule "RML-DataRetrieval"] 14 | path = RML-DataRetrieval 15 | url = http://git@github.com/RMLio/RML-DataRetrieval.git 16 | branch = master 17 | [submodule "RML-MapDocHandler"] 18 | path = RML-MapDocHandler 19 | url = http://git@github.com/RMLio/RML-MapDocHandler.git 20 | branch = master 21 | [submodule "RML-LogicalSourceHandler"] 22 | path = RML-LogicalSourceHandler 23 | url = http://git@github.com/RMLio/RML-LogicalSourceHandler.git 24 | branch = master 25 | [submodule "RML-MetadataHandler"] 26 | path = RML-MetadataHandler 27 | url = http://git@github.com/RMLio/RML-MetadataHandler.git 28 | branch = master 29 | [submodule "function-processor-java"] 30 | path = function-processor-java 31 | url = http://git@github.com/fnoio/function-processor-java.git 32 | branch = master 33 | -------------------------------------------------------------------------------- /.travis.yml: -------------------------------------------------------------------------------- 1 | language: java 2 | before_install: chmod +x bin/RML-Mapper 3 | install: bin/RML-Mapper 4 | before_deploy: cp RML-Processor/target/RML-Processor-*.jar RML-Mapper.jar 5 | deploy: 6 | provider: releases 7 | api_key: 8 | secure: jhYYzG1G2aenAERpX3cXFQ3pXgK+AYfa3Es1z6pn5DR71Yfp8jwzhXiMT2khI/HewJDxA0ZsD6izzuk9kc4bXT7f5ACvXv5wp/COJOKBaZ4AcBTaLhZgTCC3lzQMHEg5apNq0/RZe8wHheJI4qYFXuGBy3IiUUmDPBO14wLG/HZu5FiXe/+dc5vlW8ES7AnqgKKxh3cYSlK8ACMCffmPMdY4k5d7YFV2i/EXcc9Ms1oVG+yMDRx9sZu15p6LNF+dJa5JUTKX8prwuVPr87PezLi/TxwCFqPtU9XyE24QF0xsOsAZFadqA71D4XNMq1VapeI9lL8WwCSyygMFBlYce+QTqgnkZmZrumzcj7iPwsN07mPcl8uMfI1Yjj/5oP13pkdPMGoJ/JshYRLof/QyjlMJBsT+6xwvJRTIJYsjAEQraSD/nOOCZ1eAi+Rpdpl2ed7KOv+sjRJ2kZdGaLq7hvLu/sb9YlkpMXUS9965arNoTghx5uMsVHF0QHhRokNSTUL+y+rPZcdz0YTAcfO0UJiZzEY4+gVbVZ9SIS95JPXSDiG1fGZMUzKi8yyPRe3Z5o5G96DDnFlNKh9hSXHsmUIRe2gY301IQRaHMgWHyxOmWm9heAnhIBUPeBDM6/1Ew0oWQPe6CSc4xIZpKCBX77obNld9f7qOW70+1SC/B0o= 9 | file: RML-Processor/target/RML-Processor-0.2.jar 10 | on: 11 | repo: RMLio/RML-Mapper 12 | -------------------------------------------------------------------------------- /GREL_Processor/RML - Function Handler.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /GREL_Processor/pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 4.0.0 6 | 7 | be.ugent.mmlab.rml 8 | GREL-Processor 9 | 1.0-SNAPSHOT 10 | 11 | GREL - Processor 12 | http://maven.apache.org 13 | 14 | UTF-8 15 | 16 | 17 | 18 | 19 | 20 | maven-compiler-plugin 21 | 2.0.2 22 | 23 | 1.7 24 | 1.7 25 | 26 | 27 | 28 | org.apache.maven.plugins 29 | maven-jar-plugin 30 | 2.5 31 | 32 | 33 | 34 | 35 | 36 | 37 | be.ugent.mmlab.rml 38 | RML-Model 39 | 2.0-SNAPSHOT 40 | 41 | 42 | junit 43 | junit 44 | 4.12 45 | test 46 | 47 | 48 | 49 | 50 | -------------------------------------------------------------------------------- /GREL_Processor/src/main/java/be/ugent/mmlab/rml/grel/ConcreteGrelProcessor.java: -------------------------------------------------------------------------------- 1 | package be.ugent.mmlab.rml.grel; 2 | 3 | import be.ugent.mmlab.rml.model.TriplesMap; 4 | 5 | import java.util.Map; 6 | 7 | import org.slf4j.Logger; 8 | import org.slf4j.LoggerFactory; 9 | 10 | /** 11 | * GREL Processor 12 | * 13 | * 14 | * @author andimou 15 | */ 16 | public class ConcreteGrelProcessor { 17 | 18 | // Log 19 | private static final Logger log = 20 | LoggerFactory.getLogger(ConcreteGrelProcessor.class); 21 | 22 | public String processFunction( 23 | String function, TriplesMap functionTriplesMap, Object node, Map parameters) { 24 | String result = null; 25 | 26 | switch (function){ 27 | case "http://semweb.mmlab.be/ns/grel#isSet": 28 | result = isSet(parameters); 29 | break; 30 | case "http://semweb.mmlab.be/ns/grel#contains": 31 | result = contains(parameters); 32 | break; 33 | case "http://semweb.mmlab.be/ns/grel#booleanMatch": 34 | result = booleanMatch(parameters); 35 | break; 36 | default: 37 | log.error("The function " + function + " was not defined."); 38 | } 39 | return result; 40 | } 41 | 42 | public String isSet(Map parameters){ 43 | String result = null; 44 | String field = parameters.get(GrelVocabulary.GREL_NAMESPACE + GrelVocabulary.GrelTerm.VALUE_PARAMETER); 45 | if(field.isEmpty()) 46 | result = "false"; 47 | else 48 | result = "true"; 49 | return result; 50 | } 51 | 52 | public String contains(Map parameters){ 53 | String string1 = parameters.get(GrelVocabulary.GrelTerm.VALUE_PARAMETER); 54 | String string2 = parameters.get(GrelVocabulary.GrelTerm.SUBSTRING_PARAMETER); 55 | if (string1.contains(string2)) 56 | return "true"; 57 | else 58 | return "false"; 59 | } 60 | 61 | public String booleanMatch(Map parameters){ 62 | String string1 = parameters.get(GrelVocabulary.GrelTerm.VALUE_PARAMETER); 63 | String string2 = parameters.get(GrelVocabulary.GrelTerm.REGEX_PARAMETER); 64 | if (string1.matches(string2)) 65 | return "true"; 66 | else 67 | return "false"; 68 | } 69 | } 70 | -------------------------------------------------------------------------------- /GREL_Processor/src/main/java/be/ugent/mmlab/rml/grel/GrelVocabulary.java: -------------------------------------------------------------------------------- 1 | package be.ugent.mmlab.rml.grel; 2 | 3 | /** 4 | * Created by andimou on 7/10/16. 5 | */ 6 | public class GrelVocabulary { 7 | public static String GREL_NAMESPACE = "http://semweb.mmlab.be/ns/grel#"; 8 | 9 | public enum GrelTerm { 10 | 11 | // GREL CLASSES 12 | 13 | // GREL BOOLEAN PROPERTIES 14 | IS_SET("isSet"), 15 | BOOLEAN_MATCH("booleanMatch"), 16 | CONTAINS("contains"), 17 | 18 | // PARAMETERS PROPERTIES 19 | VALUE_PARAMETER("valueParameter"), 20 | SUBSTRING_PARAMETER("subStringParameter"), 21 | REGEX_PARAMETER("regexParameter"), 22 | 23 | // OUTPUT 24 | BOOLEAN_VALUE("booleanValue"); 25 | 26 | private String displayName; 27 | 28 | private GrelTerm(String displayName) { 29 | this.displayName = displayName; 30 | } 31 | 32 | @Override 33 | public String toString() { 34 | return displayName; 35 | } 36 | 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /GREL_Processor/target/maven-archiver/pom.properties: -------------------------------------------------------------------------------- 1 | #Generated by Maven 2 | #Thu Sep 29 11:38:21 CEST 2016 3 | version=1.0-SNAPSHOT 4 | groupId=be.ugent.mmlab.rml 5 | artifactId=GREL-Processor 6 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | RML Mapper 2 | ========== 3 | 4 | > ALERT! Version 4 is out! RMLMapper is _rebuilt from the ground up_ on another repository ([rmlmapper-java](https://github.com/RMLio/rmlmapper-java)). 5 | All future development will now happen there. This repository remains available as legacy. 6 | 7 | Clone RML-Mapper 8 | ---------------- 9 | 10 | git clone --recursive https://github.com/RMLio/RML-Mapper.git 11 | git submodule update --init --recursive 12 | 13 | Build RML-Mapper 14 | ---------------- 15 | 16 | Run 17 | 18 | bin/RML-Mapper 19 | 20 | Testing RML-Mapper 21 | ------------------ 22 | 23 | Copy ./resources into RML-Processor 24 | 25 | `mvn test` 26 | 27 | 28 | Run RML-Mapper 29 | ------------- 30 | 31 | bin/RML-Mapper -m -o [-b -f -tm -p -g -md - mdl -mdf -p ] 32 | 33 | 34 | Update RML-Mapper 35 | ----------------- 36 | 37 | git pull --recurse-submodules 38 | 39 | Extension FnO 40 | ------------- 41 | 42 | Data processing instructions can be added in mapping documents, and their implementations can be made available 43 | by including additional `.jar` and `.java` files under `resources/functions` of the **current working directory**. 44 | Also, a `metadata.json`-file needs to be present that includes additional metadata to allow for automatic processing. 45 | You can inspect (and/or copy) the `resources/functions`-folder of this repo to your own working directory. 46 | See https://github.com/fnoio for more implementations. 47 | -------------------------------------------------------------------------------- /bin/RML-Mapper: -------------------------------------------------------------------------------- 1 | compile () { 2 | echo "Compiling RML-Mapper started..." 3 | mvn clean install 4 | cp RML-Processor/target/RML-Processor-3.0.2.jar RML-Mapper-v3.0.2.jar 5 | echo "Compiling RML-Mapper finished..." 6 | } 7 | 8 | execute () { 9 | #check if compiled 10 | if [ ! -d "RML-Processor/target" ]; then 11 | compile 12 | fi 13 | 14 | #check if RMLMapper.jar exists 15 | if [ ! -d "RML-Mapper-v3.0.2.jar" ]; then 16 | cp RML-Processor/target/RML-Processor-3.0.2.jar RML-Mapper-v3.0.2.jar 17 | fi 18 | 19 | #excute the mapping document 20 | echo "Running RML-Mapper started..." 21 | java -jar RML-Mapper.jar $* 22 | #echo "Running RML-Mapper stopped..." 23 | } 24 | 25 | if [ "$#" -eq 0 ] ; then 26 | echo "Compilation mode" 27 | compile 28 | else 29 | echo "Execution mode" 30 | execute $* 31 | fi 32 | -------------------------------------------------------------------------------- /pom.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 4.0.0 5 | 6 | be.ugent.mmlab.rml 7 | RML-Mapper 8 | 3.0.2 9 | pom 10 | 11 | RML - Mapper 12 | http://github.org/rmlio/RML-Mapper 13 | 14 | 15 | UTF-8 16 | 1.7 17 | 1.7 18 | 3.0.2 19 | 1.0.3 20 | 1.7.12 21 | 22 | 23 | 24 | RML-Model 25 | RML-LogicalSourceHandler 26 | RML-Processor 27 | RML-Condition 28 | RML-MapDocHandler 29 | function-processor-java 30 | RML-DataRetrieval 31 | RML-MetadataHandler 32 | 33 | 34 | 35 | 36 | 37 | maven-compiler-plugin 38 | 2.0.2 39 | 40 | ${maven.compiler.source} 41 | ${maven.compiler.target} 42 | 43 | 44 | 45 | org.codehaus.mojo 46 | 1.2.1 47 | exec-maven-plugin 48 | 49 | be.ugent.mmlab.rml.main.Main 50 | 51 | 52 | 53 | org.apache.maven.plugins 54 | maven-jar-plugin 55 | 2.5 56 | 57 | 58 | org.apache.maven.plugins 59 | maven-shade-plugin 60 | 2.3 61 | 62 | 63 | package 64 | 65 | shade 66 | 67 | 68 | 69 | 71 | be.ugent.mmlab.rml.main.Main 72 | 73 | 75 | 76 | 77 | 78 | *:* 79 | 80 | META-INF/*.SF 81 | META-INF/*.DSA 82 | META-INF/*.RSA 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | -------------------------------------------------------------------------------- /resources/functions/.gitignore: -------------------------------------------------------------------------------- 1 | *.class 2 | !/*.jar -------------------------------------------------------------------------------- /resources/functions/EcodaloFunctions.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RMLio/RML-Mapper/4dc6fcd96961e2a11befb56cae93f024e9c48b82/resources/functions/EcodaloFunctions.jar -------------------------------------------------------------------------------- /resources/functions/GrelFunctions.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RMLio/RML-Mapper/4dc6fcd96961e2a11befb56cae93f024e9c48b82/resources/functions/GrelFunctions.jar -------------------------------------------------------------------------------- /resources/functions/GrelFunctions.java: -------------------------------------------------------------------------------- 1 | import java.util.Map; 2 | 3 | /** 4 | * GREL Functions 5 | * 6 | * @author andimou 7 | */ 8 | public class GrelFunctions { 9 | 10 | public static boolean isSet(String valueParameter) { 11 | return !valueParameter.isEmpty(); 12 | } 13 | 14 | public static boolean contains(String valueParameter, String subStringParameter) { 15 | return valueParameter.contains(subStringParameter); 16 | } 17 | 18 | public static boolean booleanMatch(String valueParameter, String regexParameter) { 19 | return valueParameter.matches(regexParameter); 20 | } 21 | } 22 | -------------------------------------------------------------------------------- /resources/functions/GrelProcessor.java: -------------------------------------------------------------------------------- 1 | import java.util.Map; 2 | 3 | /** 4 | * GREL Functions 5 | * 6 | * @author andimou 7 | */ 8 | public class GrelProcessor { 9 | 10 | public static boolean isSet(String valueParameter) { 11 | return !valueParameter.isEmpty(); 12 | } 13 | } 14 | -------------------------------------------------------------------------------- /resources/functions/metadata.json: -------------------------------------------------------------------------------- 1 | { 2 | "files": [ 3 | { 4 | "path": "GrelFunctions.jar", 5 | "mime": "application/java-archive", 6 | "name": "GrelFunctions", 7 | "functions": [ 8 | { 9 | "url": "http://users.ugent.be/~bjdmeest/function/grel.ttl#isSet", 10 | "name": "isSet", 11 | "parameters": [ 12 | { 13 | "url": "http://users.ugent.be/~bjdmeest/function/grel.ttl#valueParameter", 14 | "type": "xsd:string" 15 | } 16 | ], 17 | "outputs": [ 18 | { 19 | "url": "http://users.ugent.be/~bjdmeest/function/grel.ttl#boolOutput", 20 | "type": "xsd:boolean" 21 | } 22 | ] 23 | }, 24 | { 25 | "url": "http://users.ugent.be/~bjdmeest/function/grel.ttl#contains", 26 | "name": "contains", 27 | "parameters": [ 28 | { 29 | "url": "http://users.ugent.be/~bjdmeest/function/grel.ttl#valueParameter", 30 | "type": "xsd:string" 31 | }, 32 | { 33 | "url": "http://users.ugent.be/~bjdmeest/function/grel.ttl#subStringParameter", 34 | "type": "xsd:string" 35 | } 36 | ], 37 | "outputs": [ 38 | { 39 | "url": "http://users.ugent.be/~bjdmeest/function/grel.ttl#boolOutput", 40 | "type": "xsd:boolean" 41 | } 42 | ] 43 | }, 44 | { 45 | "url": "http://users.ugent.be/~bjdmeest/function/grel.ttl#booleanMatch", 46 | "name": "booleanMatch", 47 | "parameters": [ 48 | { 49 | "url": "http://users.ugent.be/~bjdmeest/function/grel.ttl#valueParameter", 50 | "type": "xsd:string" 51 | }, 52 | { 53 | "url": "http://users.ugent.be/~bjdmeest/function/grel.ttl#regexParameter", 54 | "type": "xsd:string" 55 | } 56 | ], 57 | "outputs": [ 58 | { 59 | "url": "http://users.ugent.be/~bjdmeest/function/grel.ttl#boolOutput", 60 | "type": "xsd:boolean" 61 | } 62 | ] 63 | }, 64 | { 65 | "url": "http://users.ugent.be/~bjdmeest/function/grel.ttl#toUppercase", 66 | "name": "toUppercase", 67 | "parameters": [ 68 | { 69 | "url": "http://users.ugent.be/~bjdmeest/function/grel.ttl#valueParameter", 70 | "type": "xsd:string" 71 | } 72 | ], 73 | "outputs": [ 74 | { 75 | "url": "http://users.ugent.be/~bjdmeest/function/grel.ttl#stringOutput", 76 | "type": "xsd:string" 77 | } 78 | ] 79 | }, 80 | { 81 | "url": "http://users.ugent.be/~bjdmeest/function/grel.ttl#escape", 82 | "name": "escape", 83 | "parameters": [ 84 | { 85 | "url": "http://users.ugent.be/~bjdmeest/function/grel.ttl#valueParameter", 86 | "type": "xsd:string" 87 | }, 88 | { 89 | "url": "http://users.ugent.be/~bjdmeest/function/grel.ttl#modeParameter", 90 | "type": "xsd:string" 91 | } 92 | ], 93 | "outputs": [ 94 | { 95 | "url": "http://users.ugent.be/~bjdmeest/function/grel.ttl#stringOutput", 96 | "type": "xsd:string" 97 | } 98 | ] 99 | } 100 | ] 101 | }, 102 | { 103 | "path": "EcodaloFunctions.jar", 104 | "mime": "application/java-archive", 105 | "name": "EcodaloFunctions", 106 | "functions": [ 107 | { 108 | "url": "http://users.ugent.be/~bjdmeest/function/ecodalo#decide", 109 | "name": "decide", 110 | "parameters": [ 111 | { 112 | "url": "http://users.ugent.be/~bjdmeest/function/ecodalo#input", 113 | "type": "xsd:string" 114 | }, 115 | { 116 | "url": "http://users.ugent.be/~bjdmeest/function/ecodalo#expected", 117 | "type": "xsd:string" 118 | }, 119 | { 120 | "url": "http://users.ugent.be/~bjdmeest/function/ecodalo#result", 121 | "type": "xsd:string" 122 | } 123 | ], 124 | "outputs": [ 125 | { 126 | "url": "http://users.ugent.be/~bjdmeest/function/anime.ttl#output", 127 | "type": "xsd:anyURI" 128 | } 129 | ] 130 | } 131 | ] 132 | } 133 | ] 134 | } 135 | --------------------------------------------------------------------------------