Class GemetService

  • All Implemented Interfaces:
    edu.cornell.mannlib.semservices.service.ExternalConceptService

    public class GemetService
    extends Object
    implements edu.cornell.mannlib.semservices.service.ExternalConceptService
    • Field Detail

      • logger

        protected final org.apache.commons.logging.Log logger
    • Constructor Detail

      • GemetService

        public GemetService()
    • Method Detail

      • getConcepts

        public List<edu.cornell.mannlib.semservices.bo.Concept> getConcepts​(String term)
                                                                     throws Exception
        Specified by:
        getConcepts in interface edu.cornell.mannlib.semservices.service.ExternalConceptService
        Throws:
        Exception
      • processResults

        public List<edu.cornell.mannlib.semservices.bo.Concept> processResults​(String term)
                                                                        throws Exception
        Specified by:
        processResults in interface edu.cornell.mannlib.semservices.service.ExternalConceptService
        Throws:
        Exception
      • getConceptsByURIWithSparql

        public List<edu.cornell.mannlib.semservices.bo.Concept> getConceptsByURIWithSparql​(String uri)
                                                                                    throws Exception
        Specified by:
        getConceptsByURIWithSparql in interface edu.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 Object
        key - Key to retrieve
      • getAvailableLangs

        protected String getAvailableLangs​(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 URI
        property - Property
        Throws:
        Exception
      • getRelatedConcepts

        protected String getRelatedConcepts​(String concept_uri,
                                            String relation)
                                     throws Exception
        Parameters:
        concept_uri - Concept URI
        relation - Relations
        Throws:
        Exception
      • getConceptsMatchingKeyword

        protected String getConceptsMatchingKeyword​(String keyword)
                                             throws Exception
        Parameters:
        keyword - Keyword
        Throws:
        Exception
      • getPropertyFromJson

        protected List<String> getPropertyFromJson​(String json)
      • stripConceptId

        protected String stripConceptId​(String uri)