From 8f66b10323ffb14bc5d622502d7dd12b8b6f3934 Mon Sep 17 00:00:00 2001 From: "Huda J. Khan" Date: Wed, 7 Feb 2018 15:35:05 -0500 Subject: [PATCH] integrating related term info in skos utils --- .../mannlib/semservices/util/SKOSUtils.java | 21 ++- dependencies/pom.xml | 164 ++++++++++++------ 2 files changed, 129 insertions(+), 56 deletions(-) diff --git a/api/src/main/java/edu/cornell/mannlib/semservices/util/SKOSUtils.java b/api/src/main/java/edu/cornell/mannlib/semservices/util/SKOSUtils.java index 5b8955a87..fb29b3f0b 100644 --- a/api/src/main/java/edu/cornell/mannlib/semservices/util/SKOSUtils.java +++ b/api/src/main/java/edu/cornell/mannlib/semservices/util/SKOSUtils.java @@ -1,4 +1,4 @@ -/* $This file is distributed under the terms of the license in LICENSE$ */ +/* $This file is distributed under the terms of the license in /doc/license.txt$ */ /* We are no longer using the SKOS API since Vitro has moved to V 4.0 of OWL API which does not appear to be compatible. This file will contain methods used for reading SKOS as XML and parsing it for the properties @@ -160,13 +160,19 @@ public class SKOSUtils { // conceptURI); concept.setCloseMatchURIList(closeMatchURIList); + // Notes may exist, in which case they should be employed if (addNotes) { - List notes = getNotesFromModel(conceptURI, model, - langTagValue); + List notes = getNotesFromModel(conceptURI, model, langTagValue); if (notes.size() > 0) { concept.setDefinition(notes.get(0)); } + } else { // get definitions from skos:definition + + List definitions = getDefinitionFromModel(conceptURI, model, langTagValue); + if (definitions.size() > 0) { + concept.setDefinition(definitions.get(0)); + } } } catch (Exception e) { @@ -219,12 +225,17 @@ public class SKOSUtils { String propertyURI = "http://www.w3.org/2004/02/skos/core#note"; return getLabelsFromModel(conceptURI, propertyURI, model, langTagValue); } + + private static List getDefinitionFromModel(String conceptURI, + Model model, String langTagValue) { + String propertyURI = "http://www.w3.org/2004/02/skos/core#definition"; + return getLabelsFromModel(conceptURI, propertyURI, model, langTagValue); + } private static List getCloseMatchURIsFromModel(String conceptURI, Model model) { String propertyURI = "http://www.w3.org/2004/02/skos/core#closeMatch"; - return getRelatedURIsFromModel(conceptURI, propertyURI, model); - + return getRelatedURIsFromModel(conceptURI, propertyURI, model); } private static List getExactMatchURIsFromModel(String conceptURI, diff --git a/dependencies/pom.xml b/dependencies/pom.xml index 77bc41c76..eb18519c1 100644 --- a/dependencies/pom.xml +++ b/dependencies/pom.xml @@ -7,37 +7,37 @@ org.vivoweb vitro-dependencies - 2.0.0-SNAPSHOT + 1.10.0-beta2 pom org.vivoweb vitro-project - 2.0.0-SNAPSHOT + 1.10.0-beta2 .. Vitro Dependencies - - asm asm 3.1 - - - com.github.ansell.aterms aterm-java 1.8.2 - - - cglib cglib 2.2 - + net.sourceforge.owlapi owlapi-api - 5.1.1 + 5.0.4 net.sourceforge.owlapi owlapi-apibinding - 5.1.1 + 5.0.4 @@ -163,51 +182,67 @@ + + org.semarglproject + semargl-core + 0.6.1 + + + org.semarglproject + semargl-rdfa + 0.6.1 + + + com.github.jsonld-java + jsonld-java + 0.8.3 + + + + com.fasterxml.jackson.core + jackson-core + 2.7.4 + + + + org.apache.httpcomponents + fluent-hc + 4.5.2 + org.apache.httpcomponents httpclient - 4.5.3 + 4.5.2 org.apache.httpcomponents httpmime - 4.5.3 + 4.5.2 org.apache.jena jena-arq - 3.4.0 - - - - org.apache.httpcomponents - httpclient-osgi - - - org.apache.httpcomponents - httpcore-osgi - - + 3.3.0 org.apache.jena jena-core - 3.4.0 + 3.3.0 org.apache.jena jena-sdb - 3.4.0 + 3.3.0 org.apache.jena jena-tdb - 3.4.0 + 3.3.0 org.apache.solr solr-solrj - 4.10.4 + 4.7.2 org.directwebremoting @@ -219,15 +254,30 @@ freemarker 2.3.23 + + org.glassfish + javax.json + 1.0.4 + + + org.hibernate + jtidy + r8-20060801 + org.jsoup jsoup - 1.10.3 + 1.10.1 org.owasp.antisamy antisamy - 1.5.6 + 1.5.3 + + + com.google.code.gson + gson + 2.5 @@ -239,18 +289,30 @@ org.apache.taglibs taglibs-standard-spec - 1.2.5 + 1.2.1 org.apache.taglibs taglibs-standard-impl - 1.2.5 + 1.2.1 + - com.sun.mail - javax.mail - 1.6.0 + javax.mail + mail + 1.4 + + + + edu.cornell.library.scholars + DataDistributionAPI_VIVO_1.10.0 + 1.0 + jar