[VIVO-1641] REPLACE jena afn with cross-platform regex (#105)

Resolves https://jira.duraspace.org/browse/VIVO-1641
This commit is contained in:
alessandroGalasso 2019-03-20 18:22:14 +01:00 committed by Andrew Woods
parent 12d703b4c8
commit 74b8f16aa2
6 changed files with 7 additions and 19 deletions

View file

@ -32,8 +32,6 @@ public class VitroVocabulary {
public static final String OWL = "http://www.w3.org/2002/07/owl#";
public static final String OWL_ONTOLOGY = OWL+"Ontology";
public static final String OWL_THING = OWL+"Thing";
public static final String AFN = "http://jena.apache.org/ARQ/function#";
public static final String label = vitroURI + "label";

View file

@ -1164,13 +1164,6 @@ public class JenaBaseDao extends JenaBaseDaoCon {
String describeQueryStr = "DESCRIBE <" + res.getURI() + ">" ;
// ? "PREFIX afn: <http://jena.apache.org/ARQ/function#> \n\n" +
// "DESCRIBE ?bnode \n" +
// "WHERE { \n" +
// " FILTER(afn:bnode(?bnode) = \"" + res.getId().toString() + "\")\n" +
// " ?bnode ?p ?o \n" +
// "}"
Query describeQuery = QueryFactory.create(describeQueryStr, Syntax.syntaxARQ);
QueryExecution qe = QueryExecutionFactory.create(describeQuery, ontModel);
qe.execDescribe(temp);

View file

@ -258,8 +258,7 @@ public class JenaModelUtils {
dataset.getLock().enterCriticalSection(Lock.READ);
try {
StringBuilder buff = new StringBuilder();
buff.append("PREFIX afn: <http://jena.apache.org/ARQ/function#> \n")
.append("CONSTRUCT { \n").append(" ?res <").append(property.getURI()).append("> ?o } WHERE { \n");
buff.append("CONSTRUCT { \n").append(" ?res <").append(property.getURI()).append("> ?o } WHERE { \n");
if (graphURI != null) {
buff.append(" GRAPH ").append(graphURI).append(" { \n");
}
@ -289,7 +288,6 @@ public class JenaModelUtils {
StringBuilder describeQueryStrBuff = new StringBuilder()
.append("PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> \n")
.append("PREFIX afn: <http://jena.apache.org/ARQ/function#> \n")
.append("DESCRIBE ?res WHERE { \n");
if (graphURI != null) {
describeQueryStrBuff.append("GRAPH ").append(graphURI).append("{ \n");
@ -319,7 +317,7 @@ public class JenaModelUtils {
// exclude resources in the Vitro internal namespace or in the
// OWL namespace, but allow all others
buff
.append(" FILTER (afn:namespace(?res) != \"")
.append(" FILTER (REPLACE(STR(?res),\"^(.*)(#)(.*)$\", \"$1$2\") != \"")
.append("http://www.w3.org/2002/07/owl#")
.append("\") \n")
.append(" FILTER (?res != <")

View file

@ -55,7 +55,6 @@ public class PropertyDaoJena extends JenaBaseDao implements PropertyDao {
protected static final String FAUX_PROPERTY_FLAG = "FAUX";
private static final Map<String, String> NAMESPACES = new HashMap<String, String>() {{
put("afn", VitroVocabulary.AFN);
put("owl", VitroVocabulary.OWL);
put("rdf", VitroVocabulary.RDF);
put("rdfs", VitroVocabulary.RDFS);