Class GemetService
- java.lang.Object
-
- edu.cornell.mannlib.semservices.service.impl.GemetService
-
- All Implemented Interfaces:
edu.cornell.mannlib.semservices.service.ExternalConceptService
public class GemetService extends Object implements edu.cornell.mannlib.semservices.service.ExternalConceptService
-
-
Field Summary
Fields Modifier and Type Field Description protected org.apache.commons.logging.Loglogger
-
Constructor Summary
Constructors Constructor Description GemetService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected StringgetAllTranslationsForConcept(String concept_uri, String property)protected StringgetAvailableLangs(String concept_uri)protected StringgetConcept(String concept_uri)List<edu.cornell.mannlib.semservices.bo.Concept>getConcepts(String term)List<edu.cornell.mannlib.semservices.bo.Concept>getConceptsByURIWithSparql(String uri)protected StringgetConceptsMatchingKeyword(String keyword)protected StringgetGemetResults(String url)protected StringgetJsonValue(com.fasterxml.jackson.databind.node.ObjectNode obj, String key)Get a string from a json object or an empty string if there is no value for the given keyprotected List<String>getPropertyFromJson(String json)protected StringgetRelatedConcepts(String concept_uri, String relation)protected List<String>getRelatedUris(String json)List<edu.cornell.mannlib.semservices.bo.Concept>processResults(String term)protected StringstripConceptId(String uri)
-
-
-
Method Detail
-
getConcepts
public List<edu.cornell.mannlib.semservices.bo.Concept> getConcepts(String term) throws Exception
- Specified by:
getConceptsin interfaceedu.cornell.mannlib.semservices.service.ExternalConceptService- Throws:
Exception
-
processResults
public List<edu.cornell.mannlib.semservices.bo.Concept> processResults(String term) throws Exception
- Specified by:
processResultsin interfaceedu.cornell.mannlib.semservices.service.ExternalConceptService- Throws:
Exception
-
getConceptsByURIWithSparql
public List<edu.cornell.mannlib.semservices.bo.Concept> getConceptsByURIWithSparql(String uri) throws Exception
- Specified by:
getConceptsByURIWithSparqlin interfaceedu.cornell.mannlib.semservices.service.ExternalConceptService- Throws:
Exception
-
getJsonValue
protected String getJsonValue(com.fasterxml.jackson.databind.node.ObjectNode obj, String key)
Get a string from a json object or an empty string if there is no value for the given key- Parameters:
obj- JSON Objectkey- Key to retrieve
-
getAvailableLangs
protected String getAvailableLangs(String concept_uri) throws Exception
- Parameters:
concept_uri- Concept URI- Throws:
Exception
-
getConcept
protected String getConcept(String concept_uri) throws Exception
- Parameters:
concept_uri- concept URI- Throws:
Exception
-
getAllTranslationsForConcept
protected String getAllTranslationsForConcept(String concept_uri, String property) throws Exception
- Parameters:
concept_uri- Concept URIproperty- Property- Throws:
Exception
-
getRelatedConcepts
protected String getRelatedConcepts(String concept_uri, String relation) throws Exception
- Parameters:
concept_uri- Concept URIrelation- Relations- Throws:
Exception
-
getConceptsMatchingKeyword
protected String getConceptsMatchingKeyword(String keyword) throws Exception
- Parameters:
keyword- Keyword- Throws:
Exception
-
getGemetResults
protected String getGemetResults(String url) throws Exception
- Parameters:
url- URI- Throws:
Exception
-
-