Commit 575e66d0 authored by Maxime Lefrançois's avatar Maxime Lefrançois
Browse files

updated structure and jobs

parent b17c5128
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>fr.emse.gitlab.saref</groupId>
<artifactId>saref-pipeline</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<name>SAREF-Pipeline</name>
<description>The pipeline to check SAREF extension projects and generate documentation</description>
<inceptionYear>2019</inceptionYear>
<developers>
<developer>
<name>Maxime Lefrançois</name>
<email>maxime.lefrancois@emse.fr</email>
<url>http://maxime-lefrancois.info/</url>
<organization>Ecole des mines de Saint-Etienne</organization>
<organizationUrl>http://www.mines-stetienne.fr/</organizationUrl>
<timezone>+1</timezone>
<properties>
<picUrl>http://gravatar.com/userimage/102097381/dac8aeb15edac9a93e09a7974743957f</picUrl>
</properties>
</developer>
<developer>
<name>Omar Qawasmeh</name>
<email>omar.alqawasmeh@emse.fr</email>
<url>https://perso.univ-st-etienne.fr/alo09685/</url>
<organization>Ecole des mines de Saint-Etienne</organization>
<organizationUrl>http://www.mines-stetienne.fr/</organizationUrl>
<timezone>+1</timezone>
</developer>
</developers>
<organization>
<name>École des Mines de Saint-Étienne</name>
<url>http://www.mines-stetienne.fr/</url>
</organization>
<licenses>
<license>
<name>The Apache Software License, Version 2.0</name>
<url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
</license>
</licenses>
<distributionManagement>
<snapshotRepository>
<id>ossrh</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
</snapshotRepository>
<repository>
<id>ossrh</id>
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
</repository>
</distributionManagement>
<properties>
<maven.compiler.source>1.8</maven.compiler.source>
<maven.compiler.target>1.8</maven.compiler.target>
<maven.build.timestamp.format>yyyy-MM-dd'T'HH:mm:ssZ</maven.build.timestamp.format>
<jdk.version>1.8</jdk.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<project.scm.id>git</project.scm.id>
<sparql-generate.version>2.0-SNAPSHOT</sparql-generate.version>
</properties>
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-core</artifactId>
<version>1.3</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.7.25</version>
</dependency>
<dependency>
<groupId>commons-cli</groupId>
<artifactId>commons-cli</artifactId>
<version>1.4</version>
</dependency>
<dependency>
<groupId>commons-io</groupId>
<artifactId>commons-io</artifactId>
<version>2.6</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-compress</artifactId>
<version>1.20</version>
</dependency>
<dependency>
<groupId>org.apache.commons</groupId>
<artifactId>commons-text</artifactId>
<version>1.8</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.dataformat</groupId>
<artifactId>jackson-dataformat-xml</artifactId>
<version>2.10.1</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.dataformat</groupId>
<artifactId>jackson-dataformat-yaml</artifactId>
<version>2.10.1</version>
</dependency>
<dependency>
<!-- see Porcelain https://git-scm.com/book/uz/v2/Appendix-B%3A-Embedding-Git-in-your-Applications-JGit -->
<groupId>org.eclipse.jgit</groupId>
<artifactId>org.eclipse.jgit</artifactId>
<version>5.2.1.201812262042-r</version>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.8.2</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>org.apache.jena</groupId>
<artifactId>jena-tdb</artifactId>
<version>3.13.0</version>
</dependency>
<dependency>
<groupId>fr.emse.ci</groupId>
<artifactId>sparql-generate-markdown</artifactId>
<version>${sparql-generate.version}</version>
</dependency>
<dependency>
<groupId>fr.emse.ci</groupId>
<artifactId>sparql-generate-jena</artifactId>
<version>${sparql-generate.version}</version>
</dependency>
<dependency>
<groupId>org.topbraid</groupId>
<artifactId>shacl</artifactId>
<version>1.3.1</version>
</dependency>
<dependency>
<groupId>net.sourceforge.owlapi</groupId>
<artifactId>owlexplanation</artifactId>
<version>5.0.0</version>
</dependency>
<dependency>
<groupId>net.sourceforge.owlapi</groupId>
<artifactId>org.semanticweb.hermit</artifactId>
<version>1.4.5.519</version>
</dependency>
</dependencies>
<build>
<finalName>${project.artifactId}</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>2.4.1</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<transformers>
<transformer
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>fr.emse.gitlab.saref.Main
</mainClass>
</transformer>
</transformers>
<filters>
<filter>
<artifact>*:*</artifact>
<excludes>
<exclude>META-INF/*.SF</exclude>
<exclude>META-INF/*.DSA</exclude>
<exclude>META-INF/*.RSA</exclude>
</excludes>
</filter>
</filters>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>exec-maven-plugin</artifactId>
<version>1.6.0</version>
<executions>
<execution>
<goals>
<goal>java</goal>
</goals>
</execution>
</executions>
<configuration>
<mainClass>fr.emse.gitlab.saref.Main</mainClass>
<cleanupDaemonThreads>false</cleanupDaemonThreads>
</configuration>
</plugin>
</plugins>
</build>
</project>
mvn exec:java -Dexec.mainClass="fr.emse.gitlab.saref.Main" -Dexec.args="-d ../saref-core"
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>fr.emse.gitlab.saref</groupId>
<artifactId>saref-pipeline-parent</artifactId>
<version>1.0-SNAPSHOT</version>
<relativePath>../saref-pipeline-parent/pom.xml</relativePath>
</parent>
<artifactId>saref-pipeline-cli</artifactId>
<name>SAREF-Pipeline-cli</name>
<packaging>jar</packaging>
<developers>
<developer>
<name>Omar Qawasmeh</name>
<email>omar.alqawasmeh@emse.fr</email>
<url>https://perso.univ-st-etienne.fr/alo09685/</url>
<organization>Ecole des mines de Saint-Etienne</organization>
<organizationUrl>http://www.mines-stetienne.fr/</organizationUrl>
<timezone>+1</timezone>
</developer>
</developers>
<dependencies>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-log4j12</artifactId>
<version>1.7.25</version>
</dependency>
<dependency>
<!-- see Porcelain https://git-scm.com/book/uz/v2/Appendix-B%3A-Embedding-Git-in-your-Applications-JGit -->
<groupId>org.eclipse.jgit</groupId>
<artifactId>org.eclipse.jgit</artifactId>
<version>5.2.1.201812262042-r</version>
</dependency>
<dependency>
<groupId>com.google.code.gson</groupId>
<artifactId>gson</artifactId>
<version>2.8.2</version>
<type>jar</type>
</dependency>
<dependency>
<groupId>commons-cli</groupId>
<artifactId>commons-cli</artifactId>
<version>1.4</version>
</dependency>
<dependency>
<groupId>fr.emse.gitlab.saref</groupId>
<artifactId>saref-pipeline-core</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
</dependencies>
<build>
<finalName>${project.artifactId}</finalName>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>2.4.1</version>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>shade</goal>
</goals>
<configuration>
<transformers>
<transformer
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
<mainClass>fr.emse.gitlab.saref.Main
</mainClass>
</transformer>
</transformers>
<filters>
<filter>
<artifact>*:*</artifact>
<excludes>
<exclude>META-INF/*.SF</exclude>
<exclude>META-INF/*.DSA</exclude>
<exclude>META-INF/*.RSA</exclude>
</excludes>
</filter>
</filters>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
\ No newline at end of file
///**
// *
// */
//package fr.emse.gitlab.saref.tests;
//
//import static fr.emse.gitlab.saref.tests.CMDConfigurations.*;
//
//import java.io.File;
//import java.io.FileWriter;
//import java.io.IOException;
//import java.util.Arrays;
//import java.util.concurrent.TimeUnit;
//
//import org.apache.commons.cli.CommandLine;
//import org.apache.commons.cli.ParseException;
//import org.apache.log4j.Level;
//import org.apache.log4j.Logger;
//
//import fr.emse.gitlab.saref.testsuites.TestCase;
//import fr.emse.gitlab.saref.testsuites.TestSuite;
//
///**
// * @author Omar Qawasmeh
// *
// *
// */
//public class Main {
//
// private static TestCase c1 = new TestCase(); // check Ttl
// private static TestCase c2 = new TestCase(); // check prefix
// private static TestCase c3 = new TestCase(); // check shacl
//
// @SuppressWarnings("static-access")
// public static void main(String[] args) throws ParseException, IOException {
//
// Logger.getRootLogger().setLevel(Level.OFF);
//
// CommandLine cl = CMDConfigurations.parseArguments(args);
//
// // if (cl.getOptions().length == 0 || cl.hasOption(ARG_HELP)) {
// // CMDConfigurations.displayHelp();
// // return;
// // }
//
// // String[] fileNames = cl.getOptionValues(ARG_FILE);
// // if (fileNames != null) {
// // for (String fileName : fileNames) {
// // File file = new File(fileName);
// //
// // System.out.println(file+"omar");
// // }
// // }
//
// // String[] dataTtls = cl.getOptionValues(ARG_FILE);
// // File dataTtl = new File(dataTtls[0]);
//
// String dataTtlArgs = args[0];
// String CI_JOB_ID = args[1];
// String CI_PROJECT_NAME = args[2];
// String CI_COMMIT = args[3];
//
// // System.out.println(dataTtlArgs);
// File dataTtl = new File(dataTtlArgs);
// System.out.println("******************************************************************************");
// System.out.println("To view your report file please visit:\n\n"
// + "http://localhost:8080/report.html?q=http://saref.gitlab.emse.fr/-/" + args[2] + "/-/jobs/" + args[1]
// + "/artifacts/report_output.xml");
// System.out.println("******************************************************************************");
// // String dataTtl ="src/main/resources/saref.ttl";
//
// TestSuite ts = new TestSuite();
//
//// ts.setName("Report for commit number \"" + CI_COMMIT + "\" of project " + CI_PROJECT_NAME);
//
// PrefixesTest prefixTst = new PrefixesTest();
// boolean c2_Status = prefixTst.comparePrefixMap(dataTtl, c2, ts);
//
// CheckTurtleFormat checkTtl = new CheckTurtleFormat();
// boolean c1_Status = checkTtl.checkTtlFormat(dataTtl, c1, ts);
//
// ShaclTests shaclTst = new ShaclTests();
// boolean c3_Status = shaclTst.checkShaclShape(dataTtl, c3, ts, CI_JOB_ID, CI_PROJECT_NAME);
//
//// ts.setTestcase(Arrays.asList( c1, c2, c3 ));
//
//// if (c1_Status && c2_Status && c3_Status) {
//// ts.jaxbObjectToXML(ts);
//// } else {
//// ts.jaxbObjectToXML(ts);
//// System.exit(42);
////
//// }
//
// }
//
//}
///**
// *
// */
//package fr.emse.gitlab.saref.tests;
//
//import java.io.File;
//import java.io.FileInputStream;
//import java.io.FileNotFoundException;
//import java.io.FileOutputStream;
//import java.io.OutputStream;
//import java.nio.file.Path;
//import java.nio.file.Paths;
//import java.util.HashMap;
//import java.util.HashSet;
//import java.util.Map;
//import java.util.Set;
//
//import javax.xml.bind.JAXBContext;
//import javax.xml.bind.JAXBException;
//import javax.xml.bind.Marshaller;
//
//import org.apache.jena.rdf.model.Model;
//import org.apache.jena.rdf.model.Resource;
//import org.apache.jena.riot.Lang;
//import org.apache.jena.riot.RDFDataMgr;
//import org.apache.jena.riot.RDFFormat;
//import org.slf4j.Logger;
//import org.slf4j.LoggerFactory;
//import org.topbraid.jenax.util.JenaUtil;
//import org.topbraid.shacl.validation.ValidationUtil;
//import org.topbraid.shacl.vocabulary.SH;
//
//import com.fasterxml.jackson.core.sym.Name;
//
//import fr.emse.gitlab.saref.testsuites.TestCase;
//import fr.emse.gitlab.saref.testsuites.TestSuite;
//
///**
// * @author Omar Qawasmeh
// *
// *
// */
//public class ShaclTests {
//
// // private static Logger logger = LoggerFactory.getLogger(Main.class);
//
// public static boolean checkShaclShape(File dataTtl, TestCase tstCase, TestSuite tstSuite, String projectID,
// String projectName) throws FileNotFoundException {
// boolean testResults = true;
//
// // File fileData = new File(dataTtl); // from String to file
// FileInputStream fisDataTtl = new FileInputStream(dataTtl); // from File
// // to FIS
//
// tstCase.setClassName(ShaclTests.class.getName());
// tstCase.setName(new Object() {
// }.getClass().getEnclosingMethod().getName());
//
// try {
//
// Model dataModel = JenaUtil.createDefaultModel(); // data model
// dataModel.read(fisDataTtl, "", Lang.TURTLE.getLabel()); // read the
// // FIS as
// // data
// // model
// // (fisDataTtl)
//
// String shapeTtl = "sarefShape.ttl"; // shape file, fixed.
// // String shapeTtl = "src/main/resources/sarefShape.ttl"; /* shape
// // file, fixed. */
//
// Model shapeModel = JenaUtil.createDefaultModel();
// shapeModel.read(shapeTtl);
//
// Resource reportResource = ValidationUtil.validateModel(dataModel, shapeModel, true);
//
// boolean sameFormat = reportResource.getProperty(SH.conforms).getBoolean();
//
// // logger.trace("Conforms = " + sameFormat);
//
// if (!sameFormat) {
//
// // System.err.println("Errorr! check your ttl format");
// tstCase.setStatus("danger");
// // tstCase.setSystemErr(new String[] { "Your Ttl file violates
// // the Shacl shape format" });
// tstCase.setSystemErr("Your ontology file is missing some metadata");
//
// String report = "shacl-report.ttl";
//
// File reportFile = new File(report);
//
// reportFile.createNewFile();
//
// OutputStream reportOutputStream = new FileOutputStream(reportFile);
// RDFDataMgr.write(reportOutputStream, reportResource.getModel(), RDFFormat.TURTLE);
//
// // Path reportPath = Paths.get(reportOutputStream.toString());
// // System.err.println(reportFile.getAbsolutePath());
//// tstCase.setInfo("You can download the report shape at: \n \n" + "http://saref.gitlab.emse.fr/-/"
//// + projectName + "/-/jobs/" + projectID + "/artifacts/shacl-report.ttl");
//
// // tstSuite.setTestcase(new TestCase[] { tstCase });
// // tstSuite.jaxbObjectToXML(tstSuite);
//
// testResults = false;
//
// // System.exit(42);
//
// } else {
// // System.out.println("Turtle format is ok");
// // tstCase.setSystemOut(new String[] { "Your Ttl file is
// // complete and it follows our shacl shape." });
// tstCase.setSystemOut("Your ontology file contains all the required metadata");
// tstCase.setStatus("success");
// testResults = true;
//
// }
// } catch (Throwable t) {
// testResults = false;
// tstCase.setStatus("danger");
// tstCase.setSystemErr("Your ontology file is missing some metadata");
//
// // tstCase.setSystemErr(new String[] { "Your Ttl file violates the
// // Shacl shape format" });
// // System.err.println(t.getMessage());
// // logger.error(t.getMessage());
// }
//
// return testResults;
//
// }
//
//}
//module fr.emse.gitlab.saref.climodule {
// requires fr.emse.gitlab.saref.api;
// requires fr.emse.gitlab.saref.entities;
//}
\ No newline at end of file
@prefix dash: <http://datashapes.org/dash#> .
@prefix saref: <https://saref.etsi.org/saref#> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix sh: <http://www.w3.org/ns/shacl#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix dcterms: <http://purl.org/dc/terms/> .
@prefix vann: <http://purl.org/vocab/vann/> .
saref:DatatypeExampleShape
a sh:NodeShape ;
#sh:targetNode <https://saref.etsi.org/saref#> ;
sh:targetClass owl:Ontology ;
#owl:Ontology
sh:property [
sh:targetNode <https://saref.etsi.org/saref#> ;
sh:path rdf:type ;
sh:value owl:Ontology ;
sh:minCount 1 ;
sh:maxCount 1 ;
] ;
#owl:versionIRI
sh:property [
sh:path owl:versionIRI ;
sh:nodeKind sh:IRI ;
sh:minCount 1 ;
sh:maxCount 1 ;
] ;
#owl:versionInfo
sh:property [
sh:path owl:versionInfo ;
sh:datatype xsd:string ;
sh:minCount 1 ;
] ;
#owl:priorVersion potentially an owl:priorVersion, that points to the IRI of the previous module version;
sh:property [
] ;
#owl:imports potentially one or more owl:imports that point to other ontologies (or ontology modules) to import, in their specific version.
sh:property [
] ;
#voaf:vocabulary
#sh:property [
# sh:path voaf:vocabulary ;
# sh:minCount 1 ;