Package com.tagtraum.ubermusic.wikidata
Class Wikidata
- java.lang.Object
-
- com.tagtraum.core.WebService
-
- com.tagtraum.ubermusic.wikidata.Wikidata
-
- All Implemented Interfaces:
UberMusic
public class Wikidata extends WebService implements UberMusic
Wikidata.- Author:
- Hendrik Schreiber
- See Also:
- https://www.wikidata.org
-
-
Field Summary
-
Fields inherited from class com.tagtraum.core.WebService
HTTP_METHOD_GET, HTTP_METHOD_POST, HTTP_METHOD_PUT
-
-
Constructor Summary
Constructors Constructor Description Wikidata()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description DBpedia
getDBpedia()
Entity
getEntity(String id)
Retrieve a WikiData entity.GenreOntology
getGenreOntology()
List<Similarity<AudioArtist>>
getSimilarArtists(AudioSong song)
Try to find similar artists for the given song.List<AudioSong>
lookup(AudioSong song)
Looks up metadata for a song.void
setDBpedia(DBpedia dBpedia)
void
setGenreOntology(GenreOntology genreOntology)
-
Methods inherited from class com.tagtraum.core.WebService
cacheResource, clearCache, getCache, getConnectTimeOut, getDomFactory, getJSONArray, getJSONArray, getJSONObject, getJSONObject, getJSONObjectWithPayload, getMaxAge, getReadTimeOut, getRequestDelay, getSSLSocketFactory, getUserAgent, getXmlDocument, getXmlObject, handleStatusCode, isAcceptGzipContentEncoding, openConnection, openConnection, openInputStream, readURL, setAcceptGzipContentEncoding, setCache, setConnectTimeOut, setDomFactory, setMaxAge, setNextAllowedConnection, setReadTimeOut, setRequestDelay, setSSLSocketFactory, setUserAgent, toParameterString, useCacheOnly, waitForTurn
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.tagtraum.ubermusic.UberMusic
getArtists, lookup, lookup
-
-
-
-
Method Detail
-
getGenreOntology
public GenreOntology getGenreOntology()
-
setGenreOntology
public void setGenreOntology(GenreOntology genreOntology)
-
getDBpedia
public DBpedia getDBpedia()
-
setDBpedia
public void setDBpedia(DBpedia dBpedia)
-
lookup
public List<AudioSong> lookup(AudioSong song) throws IOException
Description copied from interface:UberMusic
Looks up metadata for a song.- Specified by:
lookup
in interfaceUberMusic
- Parameters:
song
- song (query by example)- Returns:
- reference songs, empty list, if the metadata is unavailable
- Throws:
IOException
- IOException
-
getEntity
public Entity getEntity(String id) throws IOException, org.json.simple.parser.ParseException
Retrieve a WikiData entity.- Parameters:
id
- id- Returns:
- an entity
- Throws:
IOException
org.json.simple.parser.ParseException
-
getSimilarArtists
public List<Similarity<AudioArtist>> getSimilarArtists(AudioSong song) throws IOException
Description copied from interface:UberMusic
Try to find similar artists for the given song. The default implementation returns an empty list.- Specified by:
getSimilarArtists
in interfaceUberMusic
- Parameters:
song
- song- Returns:
- list of similar artists
- Throws:
IOException
- IOException
-
-