All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.github.tkurz.sparqlmm.doc.ExtensionDescriptionBuilder Maven / Gradle / Ivy

Go to download

SPARQL-MM is a multimedia-extension for SPARQL 1.1 (www.w3.org/TR/sparql11-query/‎) implemented for Sesame (http://www.openrdf.org/).

There is a newer version: 2.0
Show newest version
package com.github.tkurz.sparqlmm.doc;

import com.github.tkurz.sparqlmm.Constants;
import com.google.common.io.Files;
import com.google.common.io.Resources;
import org.openrdf.rio.RDFFormat;
import org.openrdf.rio.RDFHandlerException;

import java.io.File;
import java.io.IOException;
import java.nio.charset.Charset;
import java.util.List;

/**
 * ...
 * 

* Author: Thomas Kurz ([email protected]) */ public class ExtensionDescriptionBuilder { public static final String FUNCTION_NAMES = "META-INF/services/org.openrdf.query.algebra.evaluation.function.Function"; public static void main(String [] args) throws IOException, ClassNotFoundException, IllegalAccessException, InstantiationException, RDFHandlerException { List functionNames = Resources.readLines(Resources.getResource(FUNCTION_NAMES), Charset.forName("UTF-8")); FunctionSet functionSet = new FunctionSet(functionNames); String baseString = "ns/" + Constants.VERSION + "/function/"; File ttl = new File(baseString + "index.ttl"); Files.createParentDirs(ttl); functionSet.toRDF(ttl, RDFFormat.TURTLE); File rdf = new File(baseString + "index.rdf"); Files.createParentDirs(rdf); functionSet.toRDF(rdf, RDFFormat.RDFXML); File md = new File(baseString + "index.md"); Files.createParentDirs(md); functionSet.toMD(md); File html = new File(baseString + "index.html"); Files.createParentDirs(html); functionSet.toHTML(html); File latex = new File(baseString + "index.tex"); Files.createParentDirs(latex); functionSet.toLatex(latex); } }





© 2015 - 2024 Weber Informatics LLC | Privacy Policy