RMLio / RML-Mapper

Generate High Quality Linked Data from multiple originally (semi-)structured data (legacy)
http://RML.io
52 stars 20 forks source link

Programming with RML-Mapper #34

Closed canarvaeza closed 6 years ago

canarvaeza commented 6 years ago

Hi,

I'm trying to use RML-Mapper to transform JSON data to RDF/XML given an ontology I developed. The JSON data will be some sensor data info.

I already built the RML-Mapper and the RML-Processor, that gave me a JAR file called RML-Processor-0.3 in the target folder. I can reproduce this instruction from the RML-Processor readme java -jar target/RML-Processor-0.2.jar -m src/test/resources/example1/example.rml.ttl -o src/test/resources/example1/example1_test.output.nt

I'm trying now with different examples just to understand what happens.

The thing is that I want to program something with this, maybe not changing the RML-Processor code but making it part of my pipeline, how should I make this?.

I don't know if this is the right place to ask this but I think we don´t have a lot of documentation about the clases functions (not RML but the library) and I don´t have much experience with java JARS and Maven and all this :(

Thanks 😄

canarvaeza commented 6 years ago

Hi,

I handle this with:

1) Use mvn package in the RML-Processor folder. 2) Go to RML-Processor/target folder and copy RML-Processor-{version}-shaded.jar or RML-Processor-{version}.jar 3) Just import the jar on your project. 4) See this issue to guide your self. 5) For me the dependences in version 3 are:


import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.PrintStream;
import java.nio.charset.StandardCharsets;
import java.nio.file.Paths;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
import java.util.Scanner;
import java.util.logging.Level;
import java.util.logging.Logger;

import org.eclipse.rdf4j.model.Namespace;
import org.eclipse.rdf4j.repository.Repository;
import org.eclipse.rdf4j.repository.RepositoryException;
import org.eclipse.rdf4j.repository.RepositoryResult;
import org.eclipse.rdf4j.rio.RDFFormat;

import be.ugent.mmlab.rml.core.RMLEngine;
import be.ugent.mmlab.rml.core.StdRMLEngine;
import be.ugent.mmlab.rml.mapdochandler.extraction.std.StdRMLMappingFactory;
import be.ugent.mmlab.rml.mapdochandler.retrieval.RMLDocRetrieval;
import be.ugent.mmlab.rml.model.RMLMapping;
import be.ugent.mmlab.rml.model.TriplesMap;
import be.ugent.mmlab.rml.model.dataset.RMLDataset;
import mcas.util.IOManager;