Commit b2e5c160 authored by Maxime Lefrançois's avatar Maxime Lefrançois

some corrections

parent 012f43d1
......@@ -32,6 +32,8 @@ import java.nio.file.Path;
import java.util.Optional;
import java.util.stream.Collectors;
import org.apache.commons.io.FileUtils;
import fr.emse.gitlab.saref.SAREF;
import fr.emse.gitlab.saref.SAREFPipelineException;
import fr.emse.gitlab.saref.managers.GenerateRDFaManager;
......@@ -119,20 +121,15 @@ public class Clause_9_3_Checker extends AbstractClauseChecker {
});
}
private void requirementsRDFaGenerator() throws SAREFPipelineException{
private void requirementsRDFaGenerator() throws SAREFPipelineException, IOException{
String categoryChanger = "";
String repoName = project.getName();
String href = project.getNamespace();
File reqCSV = new File(repository.getDirectory(),"/requirements/requirements.csv");
File reqHTML = new File(repository.getDirectory(), "/target/site/requirements.html");
GenerateRDFaManager manager = new GenerateRDFaManager();
manager.GenerateRDFaManager(categoryChanger, repoName, href, reqCSV, reqHTML, "requirements");
File reqCSV = new File(repository.getDirectory(), "/requirements/requirements.csv");
File versionSite = new File(siteManager.siteDir, version.getVersionPath());
FileUtils.forceMkdir(versionSite);
File reqHTML = new File(versionSite, "requirements.html");
GenerateRDFaManager.GenerateRDFa(categoryChanger, repoName, href, reqCSV, reqHTML, "requirements");
}
}
......@@ -32,8 +32,6 @@ import java.util.List;
import java.util.Set;
import java.util.stream.Collectors;
import fr.emse.gitlab.saref.SAREFPipeline;
import fr.emse.gitlab.saref.managers.OopsManager;
import org.apache.jena.rdf.model.Model;
import org.semanticweb.owl.explanation.api.Explanation;
import org.semanticweb.owl.explanation.api.ExplanationGenerator;
......@@ -44,9 +42,13 @@ import org.semanticweb.owlapi.profiles.OWLProfileReport;
import fr.emse.gitlab.saref.SAREFPipelineException;
import fr.emse.gitlab.saref.managers.OntologyManager;
import fr.emse.gitlab.saref.managers.OopsManager;
import fr.emse.gitlab.saref.managers.RepositoryManager;
import okhttp3.*;
import okhttp3.MediaType;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.RequestBody;
import okhttp3.Response;
/**
* Checks TS 103 673 Clause 9.4.5: OWL Profile, Consistency, and Satisfiability
......@@ -73,12 +75,12 @@ public class Clause_9_4_5_Checker extends AbstractClauseChecker {
}
final OWLProfileReport report = new OWL2DLProfile().checkOntology(ontology);
if(!report.getViolations().isEmpty()) {
if (!report.getViolations().isEmpty()) {
String violations = report.getViolations().stream().map(Object::toString)
.collect(Collectors.joining("\n- ", "\n\n- ", "\n\n"));
logError(getMessage(MESSAGE.profile, violations));
}
OntologyManager ontologyManager = pipeline.getOntologyManager();
Set<Explanation<OWLAxiom>> incExplanation = ontologyManager.getInconsistenceExplanations(ontology, errorLogger);
......@@ -89,7 +91,7 @@ public class Clause_9_4_5_Checker extends AbstractClauseChecker {
} else {
ExplanationGenerator<OWLAxiom> generator = ontologyManager.getExplanationGenerator(ontology);
ontology.classesInSignature().forEach(c -> {
if(c.isOWLNothing()) {
if (c.isOWLNothing()) {
return;
}
Set<Explanation<OWLAxiom>> incExplanation2 = ontologyManager.getIncoherenceExplanations(generator, c);
......@@ -97,38 +99,29 @@ public class Clause_9_4_5_Checker extends AbstractClauseChecker {
String explanation = incExplanation2.stream().map(e -> e.getAxioms().toString())
.collect(Collectors.joining("\n- ", "\n\n- ", "\n\n"));
logError(getMessage(MESSAGE.satisfiable, c, explanation));
}
});
}
checkOops();
}
public void checkOops() throws SAREFPipelineException{
public void checkOops() throws SAREFPipelineException {
ByteArrayOutputStream out = new ByteArrayOutputStream();
String onto = "";
Model model = version.getModel();
model.write(out,"RDF/XML"); // write in string and then replace
onto = out.toString().replace("]]","] ]");
String xmlRequest = "<?xml version='1.0' encoding='UTF-8'?>" +
"<OOPSRequest>" +
"<OntologyURI></OntologyURI>" +
"<OntologyContent><![CDATA[" + onto + "]]></OntologyContent>" +
"<Pitfalls>10</Pitfalls>" +
"<OutputFormat>RDF/XML</OutputFormat>" +
"</OOPSRequest>";
model.write(out, "RDF/XML"); // write in string and then replace
onto = out.toString().replaceAll("]]", "] ]");
OopsManager manager = new OopsManager();
ArrayList<ArrayList<String>> res = new ArrayList<ArrayList<String>>();
String xmlRequest = "<?xml version='1.0' encoding='UTF-8'?>" + "<OOPSRequest>" + "<OntologyURI></OntologyURI>"
+ "<OntologyContent><![CDATA[" + onto + "]]></OntologyContent>" + "<Pitfalls>10</Pitfalls>"
+ "<OutputFormat>RDF/XML</OutputFormat>" + "</OOPSRequest>";
Object[] arrayData = new Object[0];
try{
try {
OkHttpClient httpClient = new OkHttpClient().newBuilder().build();
......@@ -136,56 +129,48 @@ public class Clause_9_4_5_Checker extends AbstractClauseChecker {
RequestBody body = RequestBody.create(xmlRequest, mediaType);
Request request = new Request.Builder()
.url("http://oops.linkeddata.es/rest")
.method("POST", body)
.addHeader("Content-Type", "application/xml")
.build();
Request request = new Request.Builder().url("http://oops.linkeddata.es/rest").method("POST", body)
.addHeader("Content-Type", "application/xml").build();
Response response = httpClient.newCall(request).execute();
String result = response.body().string();
String[] results = result.split("\\n");
List<String> pureData = new ArrayList<String>();
for(int i=0; i<results.length-1;i++){
if(results[i].startsWith("<")) {
for(int j=i; j<results.length;j++){
for (int i = 0; i < results.length; i++) {
if (results[i].startsWith("<")) {
for (int j = i; j < results.length; j++) {
pureData.add(results[j]);
}
}
}
arrayData = pureData.toArray(); // response into array
} catch (IOException e) {
logWarning(getMessage(MESSAGE.oopsError));
}
catch (IOException e) {
log(getMessage(MESSAGE.oopsError), SAREFPipeline.Mode.RELEASE, SAREFPipeline.Mode.PORTAL);
}
int count = manager.counter(arrayData);
int count = OopsManager.counter(arrayData);
ArrayList<ArrayList<String>> result = manager.getData(arrayData);
ArrayList<ArrayList<String>> result = OopsManager.getData(arrayData);
int s = 0;
ArrayList<String> results = new ArrayList<String>();
while(s < count) {
String data = result.get(0).get(s)+result.get(1).get(s)+result.get(2).get(s);
while (s < count) {
String data = result.get(0).get(s) + result.get(1).get(s) + result.get(2).get(s);
results.add(data);
s++;
}
String printData = results.stream().map(e -> e.toString()).collect(Collectors.joining("\n- ", "\n\n- ", "\n\n"));
if(count!=0) {
log(getMessage(MESSAGE.oops, printData), SAREFPipeline.Mode.RELEASE, SAREFPipeline.Mode.PORTAL);
String printData = results.stream().map(e -> e.toString())
.collect(Collectors.joining("\n- ", "\n\n- ", "\n\n"));
if (count != 0) {
logWarning(getMessage(MESSAGE.oops, printData));
}
}
}
......@@ -25,21 +25,17 @@
*/
package fr.emse.gitlab.saref.checkers;
import java.io.*;
import java.nio.file.*;
import java.io.ByteArrayOutputStream;
import java.io.File;
import java.io.IOException;
import java.nio.file.FileSystems;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.PathMatcher;
import java.util.ArrayList;
import java.util.Optional;
import java.util.stream.Collectors;
import fr.emse.gitlab.saref.SAREFPipeline;
import fr.emse.gitlab.saref.SAREFPipelineException;
import fr.emse.gitlab.saref.entities.SAREFRepository;
import fr.emse.gitlab.saref.entities.SAREFVersion;
import fr.emse.gitlab.saref.managers.DatasetManager;
import fr.emse.gitlab.saref.managers.GenerateRDFaManager;
import fr.emse.gitlab.saref.managers.RepositoryManager;
import fr.emse.gitlab.saref.managers.ThemisManager;
import okhttp3.*;
import org.apache.any23.Any23;
import org.apache.any23.extractor.ExtractionException;
import org.apache.any23.source.DocumentSource;
......@@ -47,11 +43,25 @@ import org.apache.any23.source.FileDocumentSource;
import org.apache.any23.writer.RDFXMLWriter;
import org.apache.any23.writer.TripleHandler;
import org.apache.any23.writer.TripleHandlerException;
import org.apache.commons.io.FileUtils;
import org.apache.jena.rdf.model.Model;
import org.w3c.dom.Document;
import org.w3c.dom.Element;
import org.w3c.dom.NodeList;
import fr.emse.gitlab.saref.SAREFPipelineException;
import fr.emse.gitlab.saref.entities.SAREFRepository;
import fr.emse.gitlab.saref.entities.SAREFVersion;
import fr.emse.gitlab.saref.managers.DatasetManager;
import fr.emse.gitlab.saref.managers.GenerateRDFaManager;
import fr.emse.gitlab.saref.managers.RepositoryManager;
import fr.emse.gitlab.saref.managers.ThemisManager;
import okhttp3.MediaType;
import okhttp3.OkHttpClient;
import okhttp3.Request;
import okhttp3.RequestBody;
import okhttp3.Response;
/**
* Checks TS 103 673 Clause 9.5: Ontology tests
*
......@@ -93,11 +103,11 @@ public class Clause_9_5_Checker extends AbstractClauseChecker {
String directories = Files.walk(path).filter(p -> {
try {
return p.toFile().isDirectory() && !Files.isSameFile(path, p);
} catch(IOException ex) {
} catch (IOException ex) {
return false;
}
}).map(p -> p.toString()).collect(Collectors.joining(", "));
if(directories.length()>0) {
if (directories.length() > 0) {
logWarning(getMessage(MESSAGE.directories, directories));
}
......@@ -108,10 +118,10 @@ public class Clause_9_5_Checker extends AbstractClauseChecker {
return false;
}
}).map(p -> p.getFileName().toString()).collect(Collectors.joining(", "));
if(nonCsv.length()>0) {
if (nonCsv.length() > 0) {
logError(getMessage(MESSAGE.csv, nonCsv));
}
boolean containsFile = Files.walk(path, 1).anyMatch(p -> {
return csvMatcher.matches(p);
});
......@@ -140,128 +150,99 @@ public class Clause_9_5_Checker extends AbstractClauseChecker {
});
}
public void checkThemis() throws SAREFPipelineException {
try {
File tHTML = new File(repository.getDirectory(),"target/site/tests.html");
Any23 runner = new Any23();
ByteArrayOutputStream out = new ByteArrayOutputStream();
DocumentSource source = new FileDocumentSource(tHTML);
TripleHandler handler = new RDFXMLWriter(out);
File versionSite = new File(siteManager.siteDir, version.getVersionPath());
File tHTML = new File(versionSite, "tests.html");
DocumentSource source = new FileDocumentSource(tHTML);
Any23 runner = new Any23();
try(ByteArrayOutputStream out = new ByteArrayOutputStream(); TripleHandler handler = new RDFXMLWriter(out);) {
runner.extract(source, handler);
handler.close();
String xmlData = out.toString();
ArrayList<String []> res = makeCall(xmlData,repository,datasetManager,version);
ArrayList<String[]> res = makeCall(xmlData, repository, datasetManager, version);
ArrayList<String> result = new ArrayList<String>();
for(int i = 0; i < res.size(); i++){
String response = res.get(i)[0]+", "+res.get(i)[1]+", "+res.get(i)[2];
for (int i = 0; i < res.size(); i++) {
String response = res.get(i)[0] + ", " + res.get(i)[1] + ", " + res.get(i)[2];
result.add(response);
}
String data = result.stream().map(e -> e.toString()).collect(Collectors.joining("\n- ", "\n\n- ", "\n\n"));
if(!res.isEmpty()) {
log(getMessage(MESSAGE.themis, data), SAREFPipeline.Mode.RELEASE, SAREFPipeline.Mode.RELEASE, SAREFPipeline.Mode.PORTAL);
if (!res.isEmpty()) {
String data = result.stream().map(e -> e.toString()).collect(Collectors.joining("\n- ", "\n\n- ", "\n\n"));
logWarning(getMessage(MESSAGE.themis, data));
}
} catch (FileNotFoundException e) {
e.printStackTrace();
} catch (ExtractionException | UnsupportedEncodingException e) {
e.printStackTrace();
} catch (IOException e) {
log(getMessage(MESSAGE.themisError), SAREFPipeline.Mode.RELEASE, SAREFPipeline.Mode.RELEASE, SAREFPipeline.Mode.PORTAL);
} catch (TripleHandlerException e) {
e.printStackTrace();
} catch (ExtractionException | IOException | TripleHandlerException e) {
logWarning(getMessage(MESSAGE.themisError));
}
}
public ArrayList<String[]> makeCall(String xmlData, SAREFRepository repository, DatasetManager datasetManager,
SAREFVersion version) throws SAREFPipelineException {
public ArrayList<String []> makeCall(String xmlData, SAREFRepository repository, DatasetManager datasetManager, SAREFVersion version) throws SAREFPipelineException {
ArrayList<String []> res = new ArrayList<String []>();
try{
ByteArrayOutputStream out = new ByteArrayOutputStream();
ArrayList<String[]> res = new ArrayList<String[]>();
try (ByteArrayOutputStream out = new ByteArrayOutputStream()) {
String onto = "";
Model model = version.getModel();
model.write(out,"RDF/XML");
model.write(out, "RDF/XML");
onto = out.toString();
OkHttpClient httpClient = new OkHttpClient().newBuilder().build();
MediaType mediaType = MediaType.parse("application/json");
String jsonRequest = "{\"ontologiesCode\":[\"" +
onto.replace("\\\"", "\\\\\"").replace("\"", "\\\"").replace("\t"," ") +
"\"]," + "\"testfile\":[\"" +
xmlData.replace("\\\"", "\\\\\"").replace("\"", "\\\"").replace("\t"," ") +
"\"]," + "\"format\":\"junit\"}";
String jsonRequest = "{\"ontologiesCode\":[\""
+ onto.replaceAll("\\\"", "\\\\\"").replaceAll("\"", "\\\"").replaceAll("\t", " ") + "\"],"
+ "\"testfile\":[\"" + xmlData.replaceAll("\\\"", "\\\\\"").replaceAll("\"", "\\\"").replaceAll("\t", " ")
+ "\"]," + "\"format\":\"junit\"}";
RequestBody body = RequestBody.create(jsonRequest, mediaType);
Request request = new Request.Builder()
.url("http://themis.linkeddata.es/rest/api/results")
.method("POST", body)
.addHeader("accept", "application/json")
.addHeader("Content-Type", "application/json")
.build();
Request request = new Request.Builder().url("http://themis.linkeddata.es/rest/api/results")
.method("POST", body).addHeader("accept", "application/json")
.addHeader("Content-Type", "application/json").build();
Response response = httpClient.newCall(request).execute();
String result = response.body().string();
ThemisManager manager = new ThemisManager();
Document doc = manager.convertStringToXMLDocument(result);
Document doc = ThemisManager.convertStringToXMLDocument(result);
NodeList nodeList = doc.getElementsByTagName("testcase");
for (int temp = 0; temp < nodeList.getLength(); temp++) {
org.w3c.dom.Node node = nodeList.item(temp);
String [] part = new String[3];
String[] part = new String[3];
if (node.getNodeType() == org.w3c.dom.Node.ELEMENT_NODE) {
Element element = (Element) node;
part[0] = ""+element.getAttributeNode("id");
part[1] = ""+element.getAttributeNode("name");
part[2] = ""+((Element) node).getElementsByTagName("error").item(0).getAttributes().getNamedItem("message");
part[0] = "" + element.getAttributeNode("id");
part[1] = "" + element.getAttributeNode("name");
part[2] = "" + ((Element) node).getElementsByTagName("error").item(0).getAttributes()
.getNamedItem("message");
res.add(part);
}
}
} catch (IOException e) {
log(getMessage(MESSAGE.themisError), SAREFPipeline.Mode.RELEASE, SAREFPipeline.Mode.RELEASE, SAREFPipeline.Mode.PORTAL);
logWarning(getMessage(MESSAGE.themisError));
}
return res;
}
private void testsRDFaGenerator() throws SAREFPipelineException{
private void testsRDFaGenerator() throws SAREFPipelineException, IOException {
if(pipeline.ignoreSite) {
return;
}
String categoryChanger = "";
String repoName = project.getName();
String href = project.getNamespace();
File testCSV = new File(repository.getDirectory(),"/tests/tests.csv");
File testHTML = new File(repository.getDirectory(), "/target/site/tests.html");
GenerateRDFaManager manager = new GenerateRDFaManager();
manager.GenerateRDFaManager(categoryChanger, repoName, href, testCSV, testHTML, "tests");
File testCSV = new File(repository.getDirectory(), "/tests/tests.csv");
File versionSite = new File(siteManager.siteDir, version.getVersionPath());
FileUtils.forceMkdir(versionSite);
File testHTML = new File(versionSite, "tests.html");
GenerateRDFaManager.GenerateRDFa(categoryChanger, repoName, href, testCSV, testHTML, "tests");
}
}
......@@ -45,7 +45,7 @@ public class SAREFNamedGraph {
return false;
if (getClass() != obj.getClass())
return false;
SAREFTerm other = (SAREFTerm) obj;
SAREFNamedGraph other = (SAREFNamedGraph) obj;
if (iri == null) {
if (other.iri != null)
return false;
......
/*
* Copyright 2020 ETSI
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* 3. Neither the name of the copyright holder nor the names of its contributors
* may be used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
* OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package fr.emse.gitlab.saref.managers;
import java.util.ArrayList;
public class OopsManager {
public static ArrayList<ArrayList<String>> getData(Object[] data) {
ArrayList<String> getID = new ArrayList<String>();
ArrayList<String> getName = new ArrayList<String>();
ArrayList<String> getInfo = new ArrayList<String>();
ArrayList<ArrayList<String>> elements = new ArrayList<ArrayList<String>>();
elements.add(getID);
elements.add(getName);
elements.add(getInfo);
public static ArrayList<ArrayList<String>> getData(Object[] data){
ArrayList<String> getID = new ArrayList<String>();
ArrayList<String> getName = new ArrayList<String>();
ArrayList<String> getInfo = new ArrayList<String>();
ArrayList<ArrayList<String>> elements = new ArrayList<ArrayList<String>>();
elements.add(getID);
elements.add(getName);
elements.add(getInfo);
for(int i=0; i<data.length-1;i++) {
String data2 = data[i].toString().replaceAll(" ","");
if(data2.startsWith("<oops:hasCode")){
String[] data3 = data2.split("(<|>)");
getID.add(data3[2]);
elements.set(0, getID);
}
else if(data2.startsWith("<oops:hasName")){
String[] data3 = data2.split("(<|>)");
getName.add(data3[2]);
elements.set(1, getName);
}
else if(data2.startsWith("<oops:hasDescription")){
String[] data3 = data2.split("(<|>)");
getInfo.add(data3[2]);
elements.set(2, getInfo);
}
}
return elements;
}
public static int counter(Object[] data){
int counter = 0;
for(int i=0; i<data.length-1;i++){
String data2 = data[i].toString().replaceAll(" ","");
if(data2.startsWith("<oops:hasCode")){
counter++;
}
}
return counter;
}
for (int i = 0; i < data.length; i++) {
String data2 = data[i].toString().replaceAll(" ", "");
if (data2.startsWith("<oops:hasCode")) {
String[] data3 = data2.split("(<|>)");
getID.add(data3[2]);
elements.set(0, getID);
} else if (data2.startsWith("<oops:hasName")) {
String[] data3 = data2.split("(<|>)");
getName.add(data3[2]);
elements.set(1, getName);
} else if (data2.startsWith("<oops:hasDescription")) {
String[] data3 = data2.split("(<|>)");
getInfo.add(data3[2]);
elements.set(2, getInfo);
}
}
return elements;
}
public static int counter(Object[] data) {
int counter = 0;
for (int i = 0; i < data.length; i++) {
String data2 = data[i].toString().replaceAll(" ", "");
if (data2.startsWith("<oops:hasCode")) {
counter++;
}
}
return counter;
}
}
......@@ -26,20 +26,14 @@
package fr.emse.gitlab.saref.managers;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStreamReader;
import java.nio.charset.Charset;
import java.nio.charset.MalformedInputException;
import java.nio.file.Files;
import java.util.function.Consumer;
import java.util.regex.Matcher;
import java.util.regex.Pattern;
import org.apache.jena.atlas.RuntimeIOException;
import org.apache.jena.rdf.model.Model;
import org.apache.jena.rdf.model.Resource;
import org.apache.jena.riot.Lang;
import org.eclipse.jgit.api.Git;
import org.eclipse.jgit.api.errors.GitAPIException;
import org.eclipse.jgit.lib.Ref;
......@@ -51,7 +45,6 @@ import fr.emse.gitlab.saref.SAREFPipeline;
import fr.emse.gitlab.saref.SAREFPipeline.Mode;
import fr.emse.gitlab.saref.SAREFPipelineException;
import fr.emse.gitlab.saref.entities.SAREFExample;
import fr.emse.gitlab.saref.entities.SAREFNamedGraph;
import fr.emse.gitlab.saref.entities.SAREFProject;
import fr.emse.gitlab.saref.entities.SAREFRepository;
import fr.emse.gitlab.saref.entities.SAREFTerm;
......
......@@ -76,7 +76,7 @@ public class SiteManager extends SAREFErrorLogger {
private static final String NAME_REPORT_HTML = "report.html";
private static final SPARQLExtStreamManager STREAM_MANAGER_BASE = StreamManagerFactory.get();
private final File siteDir;
public final File siteDir;
private final File reportFileHTML;
private final RootPlan planForTerm;
private final RootPlan planForOntologyVersion;
......
......@@ -103,6 +103,9 @@ public class TermSiteManager extends SAREFRepositoryErrorLogger {
model.add(term.getResource(), EX.isUsedBy, v.getResource());
});
SAREFVersion lastVersion = getLastVersion(term);
if(lastVersion == null) {
return;
}
model.add(QueryExecutionFactory.create(String.format("DESCRIBE <%s>", term.getIRI()), lastVersion.getModel()).execDescribe());
}
......
/*
* Copyright 2020 ETSI
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
* 1. Redistributions of source code must retain the above copyright notice,
* this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
* 3. Neither the name of the copyright holder nor the names of its contributors
* may be used to endorse or promote products derived from this software without
* specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
* IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE
* OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
* OF THE POSSIBILITY OF SUCH DAMAGE.
*/
package fr.emse.gitlab.saref.managers;
import org.w3c.dom.Document;
......@@ -7,30 +32,24 @@ import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import java.io.StringReader;
public class ThemisManager {
public static Document convertStringToXMLDocument(String xmlString)
{