From f08788eea0f61f3ac9fd4c0805c12913aa3a0d78 Mon Sep 17 00:00:00 2001 From: cfaeth Date: Wed, 29 Sep 2021 15:41:32 +0200 Subject: [PATCH 1/3] Preparations for Fintan integration refactored to Jena 3.11.0 also took care of some inconsistent static/dynamic parameteraizations, esp. regarding the NAMESPACE, which was sometimes referenced statically and addressed dynamically in instances. For Fintan, no static parameters are allowed. --- pom.xml | 2 +- src/java/tbx2rdf/Main.java | 4 ++-- src/java/tbx2rdf/RDF2TBX_Converter.java | 6 ++--- src/java/tbx2rdf/SAXHandler.java | 12 +++++----- src/java/tbx2rdf/TBX2RDF_Converter.java | 24 +++++++++---------- src/java/tbx2rdf/TBX2RDF_Tutorial.java | 12 +++++----- .../tbx2rdf/datasets/iate/SubjectField.java | 8 +++---- .../tbx2rdf/datasets/iate/SubjectFields.java | 4 ++-- .../tbx2rdf/datasets/lexvo/LexvoManager.java | 6 ++--- src/java/tbx2rdf/types/AdminGrp.java | 6 ++--- src/java/tbx2rdf/types/Describable.java | 4 ++-- src/java/tbx2rdf/types/DescripGrp.java | 6 ++--- src/java/tbx2rdf/types/LexicalEntry.java | 6 ++--- src/java/tbx2rdf/types/MartifHeader.java | 12 +++++----- src/java/tbx2rdf/types/Note.java | 6 ++--- src/java/tbx2rdf/types/NoteLinkInfo.java | 4 ++-- src/java/tbx2rdf/types/TBX_Terminology.java | 14 +++++------ src/java/tbx2rdf/types/Term.java | 8 +++---- src/java/tbx2rdf/types/TermComp.java | 8 +++---- src/java/tbx2rdf/types/TermCompGrp.java | 4 ++-- src/java/tbx2rdf/types/TermCompList.java | 4 ++-- src/java/tbx2rdf/types/TermNoteGrp.java | 6 ++--- src/java/tbx2rdf/types/TransacGrp.java | 10 ++++---- src/java/tbx2rdf/types/TransacNote.java | 8 +++---- src/java/tbx2rdf/types/XReference.java | 8 +++---- src/java/tbx2rdf/types/abs/impID.java | 10 ++++---- .../types/abs/impIDLangTypeTgtDtyp.java | 24 +++++++++---------- src/java/tbx2rdf/utils/VirtuosoUploader.java | 3 --- src/java/tbx2rdf/vocab/DC.java | 8 +++---- src/java/tbx2rdf/vocab/IATE.java | 8 +++---- src/java/tbx2rdf/vocab/LIME.java | 8 +++---- src/java/tbx2rdf/vocab/ONTOLEX.java | 8 +++---- src/java/tbx2rdf/vocab/PROVO.java | 8 +++---- src/java/tbx2rdf/vocab/SKOS.java | 8 +++---- src/java/tbx2rdf/vocab/TBX.java | 12 +++++----- test/tbx2rdf/Simple1Test.java | 10 ++++---- .../Simple_with_decomp_trans_Test.java | 12 +++++----- .../Simple_with_decomposition_Test.java | 14 +++++------ 38 files changed, 161 insertions(+), 164 deletions(-) diff --git a/pom.xml b/pom.xml index f557657..ebb3b3d 100644 --- a/pom.xml +++ b/pom.xml @@ -39,7 +39,7 @@ org.apache.jena apache-jena-libs pom - 2.11.1 + 3.11.0 log4j diff --git a/src/java/tbx2rdf/Main.java b/src/java/tbx2rdf/Main.java index d7181d0..329a9e1 100644 --- a/src/java/tbx2rdf/Main.java +++ b/src/java/tbx2rdf/Main.java @@ -1,7 +1,6 @@ package tbx2rdf; import tbx2rdf.types.TBX_Terminology; -import com.hp.hpl.jena.rdf.model.Model; import java.io.BufferedReader; import java.io.File; import java.io.FileInputStream; @@ -15,6 +14,7 @@ import java.util.regex.Pattern; import javax.xml.parsers.ParserConfigurationException; +import org.apache.jena.rdf.model.Model; import org.apache.jena.riot.Lang; import org.apache.jena.riot.RDFDataMgr; import org.apache.log4j.Logger; @@ -221,7 +221,7 @@ public static boolean convertBigFile() { System.err.println("output file could not be open"); return false; } - converter.convertAndSerializeLargeFile(input_file, fos, mappings); + converter.convertAndSerializeLargeFile(input_file, fos, mappings, Main.DATA_NAMESPACE); } catch (Exception e) { System.err.println(e.getMessage()); return false; diff --git a/src/java/tbx2rdf/RDF2TBX_Converter.java b/src/java/tbx2rdf/RDF2TBX_Converter.java index 212e9b6..729e2bb 100644 --- a/src/java/tbx2rdf/RDF2TBX_Converter.java +++ b/src/java/tbx2rdf/RDF2TBX_Converter.java @@ -1,9 +1,9 @@ package tbx2rdf; //JENA -import com.hp.hpl.jena.query.*; -import com.hp.hpl.jena.rdf.model.Model; -import com.hp.hpl.jena.rdf.model.RDFNode; +import org.apache.jena.query.*; +import org.apache.jena.rdf.model.Model; +import org.apache.jena.rdf.model.RDFNode; import java.util.ArrayList; import java.util.HashMap; import java.util.Iterator; diff --git a/src/java/tbx2rdf/SAXHandler.java b/src/java/tbx2rdf/SAXHandler.java index 0bd6024..f255794 100644 --- a/src/java/tbx2rdf/SAXHandler.java +++ b/src/java/tbx2rdf/SAXHandler.java @@ -10,10 +10,10 @@ import org.xml.sax.XMLReader; import org.xml.sax.helpers.DefaultHandler; -import com.hp.hpl.jena.rdf.model.Model; -import com.hp.hpl.jena.rdf.model.ModelFactory; -import com.hp.hpl.jena.rdf.model.Resource; -import com.hp.hpl.jena.vocabulary.RDF; +import org.apache.jena.rdf.model.Model; +import org.apache.jena.rdf.model.ModelFactory; +import org.apache.jena.rdf.model.Resource; +import org.apache.jena.vocabulary.RDF; import tbx2rdf.datasets.lexvo.LexvoManager; import tbx2rdf.types.MartifHeader; @@ -77,7 +77,7 @@ public Model getLexiconsModel() /** * Obtains a map of lexicons present in the */ - public HashMap getLexicons() + public HashMap getLexicons(String namespace) { lexiconsModel = ModelFactory.createDefaultModel(); final HashMap lexicons = new HashMap<>(); @@ -85,7 +85,7 @@ public HashMap getLexicons() { if (lexicons.containsKey(language)) continue; - final Resource lexicon = lexiconsModel.createResource(Main.DATA_NAMESPACE + language); + final Resource lexicon = lexiconsModel.createResource(namespace + language); Resource rlan=LexvoManager.mgr.getLexvoFromISO2(language); //lexicon.addProperty(ONTOLEX.language, rlan); //before it was the mere constant "language" //OLD lexicon.addProperty(DC.language, rlan); //before it was the mere constant "language" diff --git a/src/java/tbx2rdf/TBX2RDF_Converter.java b/src/java/tbx2rdf/TBX2RDF_Converter.java index 7bf4cb3..4af74fc 100644 --- a/src/java/tbx2rdf/TBX2RDF_Converter.java +++ b/src/java/tbx2rdf/TBX2RDF_Converter.java @@ -30,15 +30,15 @@ import org.xml.sax.SAXException; //JENA -import org.openjena.riot.Lang; +import org.apache.jena.riot.Lang; import org.apache.jena.riot.RDFDataMgr; import org.apache.jena.riot.RDFFormat; -import com.hp.hpl.jena.rdf.model.Model; -import com.hp.hpl.jena.rdf.model.ModelFactory; -import com.hp.hpl.jena.rdf.model.Property; -import com.hp.hpl.jena.rdf.model.Resource; -import com.hp.hpl.jena.vocabulary.DCTerms; -import com.hp.hpl.jena.vocabulary.RDF; +import org.apache.jena.rdf.model.Model; +import org.apache.jena.rdf.model.ModelFactory; +import org.apache.jena.rdf.model.Property; +import org.apache.jena.rdf.model.Resource; +import org.apache.jena.vocabulary.DCTerms; +import org.apache.jena.vocabulary.RDF; //TBX2RDF import java.io.PrintStream; @@ -293,7 +293,7 @@ private Collection processBack(Element root, Mappings mappings) * Processes, from a node, a termEntry * @return A Term */ - Term processTermEntry(Element node, Mappings mappings) { + public Term processTermEntry(Element node, Mappings mappings) { // create new Term // add subjectField // add ID @@ -916,8 +916,8 @@ private Mapping processType(Element sub, Mappings mappings, boolean required) { * @param mappings Mappings * @return The TBX terminology */ - public TBX_Terminology convertAndSerializeLargeFile(String file, PrintStream fos, Mappings mappings) { - String resourceURI = new String(Main.DATA_NAMESPACE); + public TBX_Terminology convertAndSerializeLargeFile(String file, PrintStream fos, Mappings mappings, String namespace) { + String resourceURI = new String(namespace); FileInputStream inputStream = null; Scanner sc = null; int count = 0; @@ -932,7 +932,7 @@ public TBX_Terminology convertAndSerializeLargeFile(String file, PrintStream fos SAXParser saxParser = factory.newSAXParser(); handler = new SAXHandler(mappings); saxParser.parse(xmlInput, handler); - lexicons = handler.getLexicons(); + lexicons = handler.getLexicons(namespace); xmlInput.close(); } catch (Exception e) { logger.warn("There was an error while reading/creting the lexicons, this could affect the rest of the code"); @@ -1051,7 +1051,7 @@ public TBX_Terminology convertAndSerializeLargeFile(String file, PrintStream fos * Gently loads a DOM XML document from a XML fragment. * If it fails, it returns null; */ - private static Document loadXMLFromString(String xml) throws Exception { + public static Document loadXMLFromString(String xml) throws Exception { try { DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); DocumentBuilder builder = factory.newDocumentBuilder(); diff --git a/src/java/tbx2rdf/TBX2RDF_Tutorial.java b/src/java/tbx2rdf/TBX2RDF_Tutorial.java index 1086025..029ca99 100644 --- a/src/java/tbx2rdf/TBX2RDF_Tutorial.java +++ b/src/java/tbx2rdf/TBX2RDF_Tutorial.java @@ -4,15 +4,15 @@ import java.io.IOException; import javax.xml.parsers.ParserConfigurationException; import org.apache.jena.riot.RDFDataMgr; -import org.openjena.riot.Lang; +import org.apache.jena.riot.Lang; import org.xml.sax.SAXException; import tbx2rdf.types.TBX_Terminology; -import com.hp.hpl.jena.rdf.model.Model; -import com.hp.hpl.jena.rdf.model.RDFNode; -import com.hp.hpl.jena.rdf.model.Resource; -import com.hp.hpl.jena.rdf.model.Statement; -import com.hp.hpl.jena.vocabulary.RDF; +import org.apache.jena.rdf.model.Model; +import org.apache.jena.rdf.model.RDFNode; +import org.apache.jena.rdf.model.Resource; +import org.apache.jena.rdf.model.Statement; +import org.apache.jena.vocabulary.RDF; import java.io.FileOutputStream; import java.io.FileReader; import java.util.List; diff --git a/src/java/tbx2rdf/datasets/iate/SubjectField.java b/src/java/tbx2rdf/datasets/iate/SubjectField.java index 2db01a7..322bf19 100644 --- a/src/java/tbx2rdf/datasets/iate/SubjectField.java +++ b/src/java/tbx2rdf/datasets/iate/SubjectField.java @@ -1,9 +1,9 @@ package tbx2rdf.datasets.iate; -import com.hp.hpl.jena.rdf.model.Model; -import com.hp.hpl.jena.rdf.model.Resource; -import com.hp.hpl.jena.vocabulary.RDF; -import com.hp.hpl.jena.vocabulary.RDFS; +import org.apache.jena.rdf.model.Model; +import org.apache.jena.rdf.model.Resource; +import org.apache.jena.vocabulary.RDF; +import org.apache.jena.vocabulary.RDFS; import tbx2rdf.types.abs.impID; import tbx2rdf.vocab.TBX; diff --git a/src/java/tbx2rdf/datasets/iate/SubjectFields.java b/src/java/tbx2rdf/datasets/iate/SubjectFields.java index 779af9e..3a39aa0 100644 --- a/src/java/tbx2rdf/datasets/iate/SubjectFields.java +++ b/src/java/tbx2rdf/datasets/iate/SubjectFields.java @@ -1,7 +1,7 @@ package tbx2rdf.datasets.iate; -import com.hp.hpl.jena.rdf.model.Model; -import com.hp.hpl.jena.rdf.model.ModelFactory; +import org.apache.jena.rdf.model.Model; +import org.apache.jena.rdf.model.ModelFactory; import java.io.BufferedReader; import java.io.InputStream; import java.io.InputStreamReader; diff --git a/src/java/tbx2rdf/datasets/lexvo/LexvoManager.java b/src/java/tbx2rdf/datasets/lexvo/LexvoManager.java index ba257b9..f0d1622 100644 --- a/src/java/tbx2rdf/datasets/lexvo/LexvoManager.java +++ b/src/java/tbx2rdf/datasets/lexvo/LexvoManager.java @@ -8,9 +8,9 @@ import java.util.StringTokenizer; //JENA -import com.hp.hpl.jena.rdf.model.Model; -import com.hp.hpl.jena.rdf.model.ModelFactory; -import com.hp.hpl.jena.rdf.model.Resource; +import org.apache.jena.rdf.model.Model; +import org.apache.jena.rdf.model.ModelFactory; +import org.apache.jena.rdf.model.Resource; /** * This class provides with methods to obtain the Lexvo resource corresponding to a language iso code. diff --git a/src/java/tbx2rdf/types/AdminGrp.java b/src/java/tbx2rdf/types/AdminGrp.java index 6f17a41..463c13f 100644 --- a/src/java/tbx2rdf/types/AdminGrp.java +++ b/src/java/tbx2rdf/types/AdminGrp.java @@ -1,8 +1,8 @@ package tbx2rdf.types; -import com.hp.hpl.jena.rdf.model.Model; -import com.hp.hpl.jena.rdf.model.Resource; -import com.hp.hpl.jena.vocabulary.RDF; +import org.apache.jena.rdf.model.Model; +import org.apache.jena.rdf.model.Resource; +import org.apache.jena.vocabulary.RDF; import java.util.ArrayList; import java.util.List; import tbx2rdf.DatatypePropertyMapping; diff --git a/src/java/tbx2rdf/types/Describable.java b/src/java/tbx2rdf/types/Describable.java index d1f3f4a..309300d 100644 --- a/src/java/tbx2rdf/types/Describable.java +++ b/src/java/tbx2rdf/types/Describable.java @@ -1,8 +1,8 @@ package tbx2rdf.types; //JENA -import com.hp.hpl.jena.rdf.model.Model; -import com.hp.hpl.jena.rdf.model.Resource; +import org.apache.jena.rdf.model.Model; +import org.apache.jena.rdf.model.Resource; //Java import java.util.ArrayList; import java.util.List; diff --git a/src/java/tbx2rdf/types/DescripGrp.java b/src/java/tbx2rdf/types/DescripGrp.java index e46b716..c529034 100644 --- a/src/java/tbx2rdf/types/DescripGrp.java +++ b/src/java/tbx2rdf/types/DescripGrp.java @@ -1,8 +1,8 @@ package tbx2rdf.types; -import com.hp.hpl.jena.rdf.model.Model; -import com.hp.hpl.jena.rdf.model.Resource; -import com.hp.hpl.jena.vocabulary.RDF; +import org.apache.jena.rdf.model.Model; +import org.apache.jena.rdf.model.Resource; +import org.apache.jena.vocabulary.RDF; import java.util.ArrayList; import java.util.List; import tbx2rdf.DatatypePropertyMapping; diff --git a/src/java/tbx2rdf/types/LexicalEntry.java b/src/java/tbx2rdf/types/LexicalEntry.java index ab6e22a..90711e9 100644 --- a/src/java/tbx2rdf/types/LexicalEntry.java +++ b/src/java/tbx2rdf/types/LexicalEntry.java @@ -3,9 +3,9 @@ import tbx2rdf.vocab.DC; import tbx2rdf.vocab.LIME; import tbx2rdf.vocab.ONTOLEX; -import com.hp.hpl.jena.rdf.model.Model; -import com.hp.hpl.jena.rdf.model.Resource; -import com.hp.hpl.jena.vocabulary.RDF; +import org.apache.jena.rdf.model.Model; +import org.apache.jena.rdf.model.Resource; +import org.apache.jena.vocabulary.RDF; import java.io.UnsupportedEncodingException; import java.net.URLEncoder; import java.util.ArrayList; diff --git a/src/java/tbx2rdf/types/MartifHeader.java b/src/java/tbx2rdf/types/MartifHeader.java index 0b986ed..6ecbe46 100644 --- a/src/java/tbx2rdf/types/MartifHeader.java +++ b/src/java/tbx2rdf/types/MartifHeader.java @@ -1,11 +1,11 @@ package tbx2rdf.types; -import com.hp.hpl.jena.rdf.model.Model; -import com.hp.hpl.jena.rdf.model.NodeIterator; -import com.hp.hpl.jena.rdf.model.RDFNode; -import com.hp.hpl.jena.rdf.model.Resource; -import com.hp.hpl.jena.vocabulary.DC_11; -import com.hp.hpl.jena.vocabulary.RDF; +import org.apache.jena.rdf.model.Model; +import org.apache.jena.rdf.model.NodeIterator; +import org.apache.jena.rdf.model.RDFNode; +import org.apache.jena.rdf.model.Resource; +import org.apache.jena.vocabulary.DC_11; +import org.apache.jena.vocabulary.RDF; import java.util.ArrayList; import java.util.List; import org.w3c.dom.Element; diff --git a/src/java/tbx2rdf/types/Note.java b/src/java/tbx2rdf/types/Note.java index fa96a44..e2ac3f0 100644 --- a/src/java/tbx2rdf/types/Note.java +++ b/src/java/tbx2rdf/types/Note.java @@ -1,8 +1,8 @@ package tbx2rdf.types; -import com.hp.hpl.jena.rdf.model.Model; -import com.hp.hpl.jena.rdf.model.Resource; -import com.hp.hpl.jena.vocabulary.RDFS; +import org.apache.jena.rdf.model.Model; +import org.apache.jena.rdf.model.Resource; +import org.apache.jena.vocabulary.RDFS; import org.w3c.dom.NodeList; import tbx2rdf.Mappings; import tbx2rdf.types.abs.impIDLang; diff --git a/src/java/tbx2rdf/types/NoteLinkInfo.java b/src/java/tbx2rdf/types/NoteLinkInfo.java index de5d5a2..c552ea5 100644 --- a/src/java/tbx2rdf/types/NoteLinkInfo.java +++ b/src/java/tbx2rdf/types/NoteLinkInfo.java @@ -1,7 +1,7 @@ package tbx2rdf.types; -import com.hp.hpl.jena.rdf.model.Model; -import com.hp.hpl.jena.rdf.model.Resource; +import org.apache.jena.rdf.model.Model; +import org.apache.jena.rdf.model.Resource; import java.util.ArrayList; import java.util.List; import tbx2rdf.Mappings; diff --git a/src/java/tbx2rdf/types/TBX_Terminology.java b/src/java/tbx2rdf/types/TBX_Terminology.java index 9434412..9ec6e91 100644 --- a/src/java/tbx2rdf/types/TBX_Terminology.java +++ b/src/java/tbx2rdf/types/TBX_Terminology.java @@ -1,12 +1,12 @@ package tbx2rdf.types; import tbx2rdf.vocab.TBX; -import com.hp.hpl.jena.rdf.model.Model; -import com.hp.hpl.jena.rdf.model.ModelFactory; -import com.hp.hpl.jena.rdf.model.Resource; -import com.hp.hpl.jena.vocabulary.DCTerms; -import com.hp.hpl.jena.vocabulary.DC_11; -import com.hp.hpl.jena.vocabulary.RDF; +import org.apache.jena.rdf.model.Model; +import org.apache.jena.rdf.model.ModelFactory; +import org.apache.jena.rdf.model.Resource; +import org.apache.jena.vocabulary.DCTerms; +import org.apache.jena.vocabulary.DC_11; +import org.apache.jena.vocabulary.RDF; import java.util.HashMap; import java.util.HashSet; import java.util.Map; @@ -68,7 +68,7 @@ public Model getModel(String resourceURI) { term.toRDF(model, concept); for (LexicalEntry le : term.Lex_entries) { if (!lexicons.containsKey(le.lang)) { - final Resource lexicon = model.createResource(Main.DATA_NAMESPACE + le.lang); + final Resource lexicon = model.createResource(resourceURI + le.lang); Resource rlan = LexvoManager.mgr.getLexvoFromISO2(le.lang); //lexicon.addProperty(ONTOLEX.language, rlan);// OLD lexicon.addProperty(LIME.language, le.lang); diff --git a/src/java/tbx2rdf/types/Term.java b/src/java/tbx2rdf/types/Term.java index 7d6ef6d..427d4f2 100644 --- a/src/java/tbx2rdf/types/Term.java +++ b/src/java/tbx2rdf/types/Term.java @@ -3,10 +3,10 @@ import tbx2rdf.vocab.ONTOLEX; import tbx2rdf.vocab.TBX; -import com.hp.hpl.jena.rdf.model.Model; -import com.hp.hpl.jena.rdf.model.Resource; -import com.hp.hpl.jena.rdf.model.Statement; -import com.hp.hpl.jena.vocabulary.RDF; +import org.apache.jena.rdf.model.Model; +import org.apache.jena.rdf.model.Resource; +import org.apache.jena.rdf.model.Statement; +import org.apache.jena.vocabulary.RDF; import java.util.HashSet; import java.util.Set; diff --git a/src/java/tbx2rdf/types/TermComp.java b/src/java/tbx2rdf/types/TermComp.java index 2347aef..de4deab 100644 --- a/src/java/tbx2rdf/types/TermComp.java +++ b/src/java/tbx2rdf/types/TermComp.java @@ -1,9 +1,9 @@ package tbx2rdf.types; -import com.hp.hpl.jena.rdf.model.Model; -import com.hp.hpl.jena.rdf.model.Resource; -import com.hp.hpl.jena.vocabulary.RDF; -import com.hp.hpl.jena.vocabulary.RDFS; +import org.apache.jena.rdf.model.Model; +import org.apache.jena.rdf.model.Resource; +import org.apache.jena.vocabulary.RDF; +import org.apache.jena.vocabulary.RDFS; import tbx2rdf.Mappings; import tbx2rdf.types.abs.impIDLang; import tbx2rdf.vocab.ONTOLEX; diff --git a/src/java/tbx2rdf/types/TermCompGrp.java b/src/java/tbx2rdf/types/TermCompGrp.java index e3717e6..448a284 100644 --- a/src/java/tbx2rdf/types/TermCompGrp.java +++ b/src/java/tbx2rdf/types/TermCompGrp.java @@ -1,7 +1,7 @@ package tbx2rdf.types; -import com.hp.hpl.jena.rdf.model.Model; -import com.hp.hpl.jena.rdf.model.Resource; +import org.apache.jena.rdf.model.Model; +import org.apache.jena.rdf.model.Resource; import java.util.ArrayList; import java.util.List; import tbx2rdf.Mappings; diff --git a/src/java/tbx2rdf/types/TermCompList.java b/src/java/tbx2rdf/types/TermCompList.java index 4e12205..e401d24 100644 --- a/src/java/tbx2rdf/types/TermCompList.java +++ b/src/java/tbx2rdf/types/TermCompList.java @@ -1,7 +1,7 @@ package tbx2rdf.types; -import com.hp.hpl.jena.rdf.model.Model; -import com.hp.hpl.jena.rdf.model.Resource; +import org.apache.jena.rdf.model.Model; +import org.apache.jena.rdf.model.Resource; import java.util.ArrayList; import java.util.List; import tbx2rdf.Mapping; diff --git a/src/java/tbx2rdf/types/TermNoteGrp.java b/src/java/tbx2rdf/types/TermNoteGrp.java index 02569c9..36a34ab 100644 --- a/src/java/tbx2rdf/types/TermNoteGrp.java +++ b/src/java/tbx2rdf/types/TermNoteGrp.java @@ -1,8 +1,8 @@ package tbx2rdf.types; -import com.hp.hpl.jena.rdf.model.Model; -import com.hp.hpl.jena.rdf.model.Resource; -import com.hp.hpl.jena.vocabulary.RDF; +import org.apache.jena.rdf.model.Model; +import org.apache.jena.rdf.model.Resource; +import org.apache.jena.vocabulary.RDF; import tbx2rdf.Mappings; import tbx2rdf.vocab.TBX; diff --git a/src/java/tbx2rdf/types/TransacGrp.java b/src/java/tbx2rdf/types/TransacGrp.java index 886aefc..284a826 100644 --- a/src/java/tbx2rdf/types/TransacGrp.java +++ b/src/java/tbx2rdf/types/TransacGrp.java @@ -1,10 +1,10 @@ package tbx2rdf.types; -import com.hp.hpl.jena.graph.NodeFactory; -import com.hp.hpl.jena.rdf.model.Model; -import com.hp.hpl.jena.rdf.model.Resource; -import com.hp.hpl.jena.vocabulary.RDF; -import com.hp.hpl.jena.vocabulary.XSD; +import org.apache.jena.graph.NodeFactory; +import org.apache.jena.rdf.model.Model; +import org.apache.jena.rdf.model.Resource; +import org.apache.jena.vocabulary.RDF; +import org.apache.jena.vocabulary.XSD; import java.util.ArrayList; import java.util.List; diff --git a/src/java/tbx2rdf/types/TransacNote.java b/src/java/tbx2rdf/types/TransacNote.java index 657bbe2..2fdc0ec 100644 --- a/src/java/tbx2rdf/types/TransacNote.java +++ b/src/java/tbx2rdf/types/TransacNote.java @@ -1,9 +1,9 @@ package tbx2rdf.types; -import com.hp.hpl.jena.rdf.model.Model; -import com.hp.hpl.jena.rdf.model.Resource; -import com.hp.hpl.jena.vocabulary.RDF; -import com.hp.hpl.jena.vocabulary.RDFS; +import org.apache.jena.rdf.model.Model; +import org.apache.jena.rdf.model.Resource; +import org.apache.jena.vocabulary.RDF; +import org.apache.jena.vocabulary.RDFS; import java.util.HashMap; import java.util.Map; import java.util.UUID; diff --git a/src/java/tbx2rdf/types/XReference.java b/src/java/tbx2rdf/types/XReference.java index 70f756b..c0ddf97 100644 --- a/src/java/tbx2rdf/types/XReference.java +++ b/src/java/tbx2rdf/types/XReference.java @@ -1,10 +1,10 @@ package tbx2rdf.types; import tbx2rdf.vocab.TBX; -import com.hp.hpl.jena.rdf.model.Model; -import com.hp.hpl.jena.rdf.model.Resource; -import com.hp.hpl.jena.rdf.model.Statement; -import com.hp.hpl.jena.vocabulary.RDF; +import org.apache.jena.rdf.model.Model; +import org.apache.jena.rdf.model.Resource; +import org.apache.jena.rdf.model.Statement; +import org.apache.jena.vocabulary.RDF; import tbx2rdf.types.abs.impIDType; /** diff --git a/src/java/tbx2rdf/types/abs/impID.java b/src/java/tbx2rdf/types/abs/impID.java index 32c1cd0..9bb4ec7 100644 --- a/src/java/tbx2rdf/types/abs/impID.java +++ b/src/java/tbx2rdf/types/abs/impID.java @@ -1,10 +1,10 @@ package tbx2rdf.types.abs; -import com.hp.hpl.jena.datatypes.RDFDatatype; -import com.hp.hpl.jena.graph.NodeFactory; -import com.hp.hpl.jena.rdf.model.Model; -import com.hp.hpl.jena.rdf.model.Resource; -import com.hp.hpl.jena.vocabulary.RDF; +import org.apache.jena.datatypes.RDFDatatype; +import org.apache.jena.graph.NodeFactory; +import org.apache.jena.rdf.model.Model; +import org.apache.jena.rdf.model.Resource; +import org.apache.jena.vocabulary.RDF; import java.io.StringWriter; import java.util.UUID; diff --git a/src/java/tbx2rdf/types/abs/impIDLangTypeTgtDtyp.java b/src/java/tbx2rdf/types/abs/impIDLangTypeTgtDtyp.java index f95a12f..cd4faf4 100644 --- a/src/java/tbx2rdf/types/abs/impIDLangTypeTgtDtyp.java +++ b/src/java/tbx2rdf/types/abs/impIDLangTypeTgtDtyp.java @@ -1,17 +1,17 @@ package tbx2rdf.types.abs; -import com.hp.hpl.jena.graph.NodeFactory; -import com.hp.hpl.jena.rdf.model.Model; -import com.hp.hpl.jena.rdf.model.ModelFactory; -import com.hp.hpl.jena.rdf.model.Property; -import com.hp.hpl.jena.rdf.model.RDFNode; -import com.hp.hpl.jena.rdf.model.Resource; -import com.hp.hpl.jena.rdf.model.Selector; -import com.hp.hpl.jena.rdf.model.SimpleSelector; -import com.hp.hpl.jena.rdf.model.Statement; -import com.hp.hpl.jena.rdf.model.StmtIterator; -import com.hp.hpl.jena.vocabulary.DCTerms; -import com.hp.hpl.jena.vocabulary.RDFS; +import org.apache.jena.graph.NodeFactory; +import org.apache.jena.rdf.model.Model; +import org.apache.jena.rdf.model.ModelFactory; +import org.apache.jena.rdf.model.Property; +import org.apache.jena.rdf.model.RDFNode; +import org.apache.jena.rdf.model.Resource; +import org.apache.jena.rdf.model.Selector; +import org.apache.jena.rdf.model.SimpleSelector; +import org.apache.jena.rdf.model.Statement; +import org.apache.jena.rdf.model.StmtIterator; +import org.apache.jena.vocabulary.DCTerms; +import org.apache.jena.vocabulary.RDFS; import java.lang.reflect.Method; import java.net.URI; import java.net.URISyntaxException; diff --git a/src/java/tbx2rdf/utils/VirtuosoUploader.java b/src/java/tbx2rdf/utils/VirtuosoUploader.java index f7dc82f..75f1d9b 100644 --- a/src/java/tbx2rdf/utils/VirtuosoUploader.java +++ b/src/java/tbx2rdf/utils/VirtuosoUploader.java @@ -1,8 +1,5 @@ package tbx2rdf.utils; -import com.hp.hpl.jena.query.*; -import com.hp.hpl.jena.rdf.model.RDFNode; - import java.io.BufferedReader; import java.io.File; import java.io.FileReader; diff --git a/src/java/tbx2rdf/vocab/DC.java b/src/java/tbx2rdf/vocab/DC.java index ef7c7ce..74df253 100644 --- a/src/java/tbx2rdf/vocab/DC.java +++ b/src/java/tbx2rdf/vocab/DC.java @@ -1,9 +1,9 @@ package tbx2rdf.vocab; -import com.hp.hpl.jena.rdf.model.Model; -import com.hp.hpl.jena.rdf.model.ModelFactory; -import com.hp.hpl.jena.rdf.model.Property; -import com.hp.hpl.jena.rdf.model.Resource; +import org.apache.jena.rdf.model.Model; +import org.apache.jena.rdf.model.ModelFactory; +import org.apache.jena.rdf.model.Property; +import org.apache.jena.rdf.model.Resource; /** * Common Jena Resources for Dublincore diff --git a/src/java/tbx2rdf/vocab/IATE.java b/src/java/tbx2rdf/vocab/IATE.java index b692023..b52cac8 100644 --- a/src/java/tbx2rdf/vocab/IATE.java +++ b/src/java/tbx2rdf/vocab/IATE.java @@ -1,9 +1,9 @@ package tbx2rdf.vocab; -import com.hp.hpl.jena.rdf.model.Model; -import com.hp.hpl.jena.rdf.model.ModelFactory; -import com.hp.hpl.jena.rdf.model.Property; -import com.hp.hpl.jena.rdf.model.Resource; +import org.apache.jena.rdf.model.Model; +import org.apache.jena.rdf.model.ModelFactory; +import org.apache.jena.rdf.model.Property; +import org.apache.jena.rdf.model.Resource; /** * Common Jena Resources for IATE diff --git a/src/java/tbx2rdf/vocab/LIME.java b/src/java/tbx2rdf/vocab/LIME.java index d5b9387..9c4164a 100644 --- a/src/java/tbx2rdf/vocab/LIME.java +++ b/src/java/tbx2rdf/vocab/LIME.java @@ -1,9 +1,9 @@ package tbx2rdf.vocab; -import com.hp.hpl.jena.rdf.model.Model; -import com.hp.hpl.jena.rdf.model.ModelFactory; -import com.hp.hpl.jena.rdf.model.Property; -import com.hp.hpl.jena.rdf.model.Resource; +import org.apache.jena.rdf.model.Model; +import org.apache.jena.rdf.model.ModelFactory; +import org.apache.jena.rdf.model.Property; +import org.apache.jena.rdf.model.Resource; /** diff --git a/src/java/tbx2rdf/vocab/ONTOLEX.java b/src/java/tbx2rdf/vocab/ONTOLEX.java index efb0b20..e00b417 100644 --- a/src/java/tbx2rdf/vocab/ONTOLEX.java +++ b/src/java/tbx2rdf/vocab/ONTOLEX.java @@ -1,9 +1,9 @@ package tbx2rdf.vocab; -import com.hp.hpl.jena.rdf.model.Model; -import com.hp.hpl.jena.rdf.model.ModelFactory; -import com.hp.hpl.jena.rdf.model.Property; -import com.hp.hpl.jena.rdf.model.Resource; +import org.apache.jena.rdf.model.Model; +import org.apache.jena.rdf.model.ModelFactory; +import org.apache.jena.rdf.model.Property; +import org.apache.jena.rdf.model.Resource; /** * Common Jena Resources for Dublincore diff --git a/src/java/tbx2rdf/vocab/PROVO.java b/src/java/tbx2rdf/vocab/PROVO.java index 45fa7c3..36b4895 100644 --- a/src/java/tbx2rdf/vocab/PROVO.java +++ b/src/java/tbx2rdf/vocab/PROVO.java @@ -1,9 +1,9 @@ package tbx2rdf.vocab; -import com.hp.hpl.jena.rdf.model.Model; -import com.hp.hpl.jena.rdf.model.ModelFactory; -import com.hp.hpl.jena.rdf.model.Property; -import com.hp.hpl.jena.rdf.model.Resource; +import org.apache.jena.rdf.model.Model; +import org.apache.jena.rdf.model.ModelFactory; +import org.apache.jena.rdf.model.Property; +import org.apache.jena.rdf.model.Resource; /** * Common Jena Resources for Provo - the W3C provenance ontology diff --git a/src/java/tbx2rdf/vocab/SKOS.java b/src/java/tbx2rdf/vocab/SKOS.java index 57c8e07..b6ae843 100644 --- a/src/java/tbx2rdf/vocab/SKOS.java +++ b/src/java/tbx2rdf/vocab/SKOS.java @@ -1,9 +1,9 @@ package tbx2rdf.vocab; -import com.hp.hpl.jena.rdf.model.Model; -import com.hp.hpl.jena.rdf.model.ModelFactory; -import com.hp.hpl.jena.rdf.model.Property; -import com.hp.hpl.jena.rdf.model.Resource; +import org.apache.jena.rdf.model.Model; +import org.apache.jena.rdf.model.ModelFactory; +import org.apache.jena.rdf.model.Property; +import org.apache.jena.rdf.model.Resource; /** * Class with some common static terms diff --git a/src/java/tbx2rdf/vocab/TBX.java b/src/java/tbx2rdf/vocab/TBX.java index 34facd9..06fdf93 100644 --- a/src/java/tbx2rdf/vocab/TBX.java +++ b/src/java/tbx2rdf/vocab/TBX.java @@ -1,11 +1,11 @@ package tbx2rdf.vocab; -import com.hp.hpl.jena.rdf.model.Model; -import com.hp.hpl.jena.rdf.model.ModelFactory; -import com.hp.hpl.jena.rdf.model.Property; -import com.hp.hpl.jena.rdf.model.Resource; -import com.hp.hpl.jena.rdf.model.Statement; -import com.hp.hpl.jena.vocabulary.DCTerms; +import org.apache.jena.rdf.model.Model; +import org.apache.jena.rdf.model.ModelFactory; +import org.apache.jena.rdf.model.Property; +import org.apache.jena.rdf.model.Resource; +import org.apache.jena.rdf.model.Statement; +import org.apache.jena.vocabulary.DCTerms; /** * Class with some common static terms diff --git a/test/tbx2rdf/Simple1Test.java b/test/tbx2rdf/Simple1Test.java index 265a831..9bd5f33 100644 --- a/test/tbx2rdf/Simple1Test.java +++ b/test/tbx2rdf/Simple1Test.java @@ -1,10 +1,10 @@ package tbx2rdf; -import com.hp.hpl.jena.rdf.model.Model; -import com.hp.hpl.jena.rdf.model.RDFNode; -import com.hp.hpl.jena.rdf.model.Resource; -import com.hp.hpl.jena.rdf.model.Statement; -import com.hp.hpl.jena.vocabulary.RDF; +import org.apache.jena.rdf.model.Model; +import org.apache.jena.rdf.model.RDFNode; +import org.apache.jena.rdf.model.Resource; +import org.apache.jena.rdf.model.Statement; +import org.apache.jena.vocabulary.RDF; import java.io.FileReader; import java.util.List; import org.junit.After; diff --git a/test/tbx2rdf/Simple_with_decomp_trans_Test.java b/test/tbx2rdf/Simple_with_decomp_trans_Test.java index ac6137c..6e8ead2 100644 --- a/test/tbx2rdf/Simple_with_decomp_trans_Test.java +++ b/test/tbx2rdf/Simple_with_decomp_trans_Test.java @@ -1,10 +1,10 @@ package tbx2rdf; -import com.hp.hpl.jena.rdf.model.Model; -import com.hp.hpl.jena.rdf.model.RDFNode; -import com.hp.hpl.jena.rdf.model.Statement; -import com.hp.hpl.jena.vocabulary.RDF; -import com.hp.hpl.jena.vocabulary.RDFS; +import org.apache.jena.rdf.model.Model; +import org.apache.jena.rdf.model.RDFNode; +import org.apache.jena.rdf.model.Statement; +import org.apache.jena.vocabulary.RDF; +import org.apache.jena.vocabulary.RDFS; import java.io.FileReader; import java.util.List; @@ -15,7 +15,7 @@ import org.junit.Before; import org.junit.BeforeClass; import org.junit.Test; -import org.openjena.riot.Lang; +import org.apache.jena.riot.Lang; import static tbx2rdf.Main.output_file; import tbx2rdf.types.TBX_Terminology; diff --git a/test/tbx2rdf/Simple_with_decomposition_Test.java b/test/tbx2rdf/Simple_with_decomposition_Test.java index 37878c3..08ef031 100644 --- a/test/tbx2rdf/Simple_with_decomposition_Test.java +++ b/test/tbx2rdf/Simple_with_decomposition_Test.java @@ -1,11 +1,11 @@ package tbx2rdf; -import com.hp.hpl.jena.rdf.model.Model; -import com.hp.hpl.jena.rdf.model.RDFNode; -import com.hp.hpl.jena.rdf.model.Resource; -import com.hp.hpl.jena.rdf.model.Statement; -import com.hp.hpl.jena.vocabulary.RDF; -import com.hp.hpl.jena.vocabulary.RDFS; +import org.apache.jena.rdf.model.Model; +import org.apache.jena.rdf.model.RDFNode; +import org.apache.jena.rdf.model.Resource; +import org.apache.jena.rdf.model.Statement; +import org.apache.jena.vocabulary.RDF; +import org.apache.jena.vocabulary.RDFS; import java.io.FileReader; import java.util.List; import org.apache.jena.riot.RDFDataMgr; @@ -15,7 +15,7 @@ import org.junit.Before; import org.junit.BeforeClass; import org.junit.Test; -import org.openjena.riot.Lang; +import org.apache.jena.riot.Lang; import tbx2rdf.types.TBX_Terminology; import tbx2rdf.vocab.DC; import tbx2rdf.vocab.LIME; From 0e7985fd0614a404dab00712299c73c37074f98f Mon Sep 17 00:00:00 2001 From: Mohammad Fazleh Elahi Date: Fri, 3 Dec 2021 12:28:58 +0100 Subject: [PATCH 2/3] jena3 and jena2 compatibility, some codes commented --- nb-configuration.xml | 18 ++++++++++++++++++ src/java/tbx2rdf/utils/VirtuosoUploader.java | 4 ++-- 2 files changed, 20 insertions(+), 2 deletions(-) create mode 100644 nb-configuration.xml diff --git a/nb-configuration.xml b/nb-configuration.xml new file mode 100644 index 0000000..9ce552c --- /dev/null +++ b/nb-configuration.xml @@ -0,0 +1,18 @@ + + + + + + JDK_11 + + diff --git a/src/java/tbx2rdf/utils/VirtuosoUploader.java b/src/java/tbx2rdf/utils/VirtuosoUploader.java index 75f1d9b..2d3ab21 100644 --- a/src/java/tbx2rdf/utils/VirtuosoUploader.java +++ b/src/java/tbx2rdf/utils/VirtuosoUploader.java @@ -46,7 +46,7 @@ public static void main(String[] args) { public static void deleteAll() { VirtGraph grafo = new VirtGraph (graph, url, user, passwd); - grafo.clear(); + //grafo.clear(); } @@ -102,7 +102,7 @@ private static void addElements(String graph, String triples) { String str = "INSERT INTO GRAPH <" + graph + "> { " + triples + " }"; VirtuosoUpdateRequest vur = VirtuosoUpdateFactory.create(str, set); vur.exec(); - set.close(); + //set.close(); } else { System.err.println("No se ha especificado la configuraciĆ³n de virtuoso"); } From 58ca1dbc0fe1d4614f84459aecba610c9af6465c Mon Sep 17 00:00:00 2001 From: cfaeth Date: Thu, 13 Jan 2022 16:56:27 +0100 Subject: [PATCH 3/3] Fixed an error during mvn build process. In pom.xml: changed reference to missing file readme.txt into README.md --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index ebb3b3d..5f8b528 100644 --- a/pom.xml +++ b/pom.xml @@ -193,7 +193,7 @@ - +