Commit 692b12f9 authored by Maxime Lefrançois's avatar Maxime Lefrançois
Browse files

added metadata

parent e8c4ab0a
......@@ -30,6 +30,7 @@ import org.apache.jena.rdf.model.Resource;
import org.apache.jena.rdf.model.ResourceFactory;
import org.apache.jena.riot.Lang;
import org.apache.jena.vocabulary.DCTerms;
import org.apache.jena.vocabulary.OWL;
import org.apache.jena.vocabulary.OWL2;
import org.apache.jena.vocabulary.RDF;
import org.apache.jena.vocabulary.RDFS;
......@@ -43,6 +44,7 @@ import fr.emse.gitlab.saref.entities.git.ReleaseVersion;
import fr.emse.gitlab.saref.entities.git.Version;
import fr.emse.gitlab.saref.vocabs.EX;
import fr.emse.gitlab.saref.vocabs.RDFP;
import fr.emse.gitlab.saref.vocabs.SCHEMA;
import fr.emse.gitlab.saref.vocabs.VANN;
public class ReadOntology extends JobRunner {
......@@ -225,6 +227,7 @@ public class ReadOntology extends JobRunner {
termModel.add(t, RDFS.isDefinedBy, version.getResource());
// keep the most recent definition of the term
if (version.getNextVersion() == null) {
termModel.add(DCTerms.modified, RDF.type, OWL.AnnotationProperty);
termModel.add(t, DCTerms.modified, SIMPLE_DATE_FORMAT.format(version.getIssued()), XSDDatatype.XSDdate);
try (QueryExecution exec = QueryExecutionFactory.create("DESCRIBE <" + t.getURI() + ">", model)) {
termModel.add(exec.execDescribe());
......@@ -263,6 +266,25 @@ public class ReadOntology extends JobRunner {
model.removeAll(ontologySeries, DCTerms.license, null);
model.add(ontologySeries, DCTerms.license, ETSI_LICENSE);
model.add(VANN.preferredNamespaceUri, RDF.type, OWL.AnnotationProperty);
model.add(VANN.preferredNamespacePrefix, RDF.type, OWL.AnnotationProperty);
model.add(DCTerms.title, RDF.type, OWL.AnnotationProperty);
model.add(DCTerms.title, RDF.type, OWL.AnnotationProperty);
model.add(DCTerms.title, RDF.type, OWL.AnnotationProperty);
model.add(DCTerms.abstract_, RDF.type, OWL.AnnotationProperty);
model.add(DCTerms.description, RDF.type, OWL.AnnotationProperty);
model.add(DCTerms.creator, RDF.type, OWL.AnnotationProperty);
model.add(DCTerms.contributor, RDF.type, OWL.AnnotationProperty);
model.add(DCTerms.publisher, RDF.type, OWL.AnnotationProperty);
model.add(DCTerms.issued, RDF.type, OWL.AnnotationProperty);
model.add(DCTerms.modified, RDF.type, OWL.AnnotationProperty);
model.add(DCTerms.license, RDF.type, OWL.AnnotationProperty);
model.add(SCHEMA.Person, RDF.type, OWL.Class);
model.add(SCHEMA.Organization, RDF.type, OWL.Class);
model.add(SCHEMA.familyName, RDF.type, OWL.DatatypeProperty);
model.add(SCHEMA.givenName, RDF.type, OWL.DatatypeProperty);
model.add(SCHEMA.name, RDF.type, OWL.DatatypeProperty);
// // list of contributors
// Set<Contributor> contributors = new HashSet<>();
// for (Iterator<RevCommit> it = git.log().add(version.ref.getObjectId()).call().iterator(); it.hasNext();) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment