Package com.tagtraum.genres.rdf
Class RDFGenreOntology
- java.lang.Object
-
- com.tagtraum.genres.rdf.RDFGenreOntology
-
- All Implemented Interfaces:
GenreOntology
- Direct Known Subclasses:
DBpediaOntology
,TagtraumDeuOntology
,TagtraumEngOntology
,TagtraumEspOntology
,TagtraumFraOntology
,TagtraumIntlOntology
,TagtraumNldOntology
,WikidataOntology
public class RDFGenreOntology extends Object implements GenreOntology
RDF based genre ontology.- Author:
- Hendrik Schreiber
-
-
Constructor Summary
Constructors Constructor Description RDFGenreOntology(StatementReader reader, String namespace)
RDFGenreOntology(String resource, String namespace)
RDFGenreOntology(Collection<Statement> statements, String namespace)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getDepth()
Number of hierarchy levels in this ontology.Collection<AudioGenre>
getGenres()
Collection of all genres contained in this ontology.Set<AudioGenre>
getGenres(String label)
Return the genre(s) registered under the given label.AudioGenre
getGenreWithIRI(String iri)
Returns a genre with the given IRI.Set<String>
getLabels()
Set of all genre labels.String
getNamespace()
String
toString()
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.tagtraum.genres.GenreOntology
getGenres
-
-
-
-
Constructor Detail
-
RDFGenreOntology
public RDFGenreOntology(String resource, String namespace) throws IOException
- Throws:
IOException
-
RDFGenreOntology
public RDFGenreOntology(StatementReader reader, String namespace) throws IOException
- Throws:
IOException
-
RDFGenreOntology
public RDFGenreOntology(Collection<Statement> statements, String namespace)
-
-
Method Detail
-
getNamespace
public String getNamespace()
-
getGenres
public Collection<AudioGenre> getGenres()
Description copied from interface:GenreOntology
Collection of all genres contained in this ontology.- Specified by:
getGenres
in interfaceGenreOntology
- Returns:
- genres
-
getGenres
public Set<AudioGenre> getGenres(String label)
Description copied from interface:GenreOntology
Return the genre(s) registered under the given label. Due to ambiguities having to do with translations, this method may return more than one genre.- Specified by:
getGenres
in interfaceGenreOntology
- Parameters:
label
- label- Returns:
- set of mapped genres
-
getGenreWithIRI
public AudioGenre getGenreWithIRI(String iri)
Description copied from interface:GenreOntology
Returns a genre with the given IRI.- Specified by:
getGenreWithIRI
in interfaceGenreOntology
- Parameters:
iri
- IRI- Returns:
- the requested genre
-
getLabels
public Set<String> getLabels()
Description copied from interface:GenreOntology
Set of all genre labels.- Specified by:
getLabels
in interfaceGenreOntology
- Returns:
- labels
-
getDepth
public int getDepth()
Description copied from interface:GenreOntology
Number of hierarchy levels in this ontology. An ontology with one or more members has at least the depth1
. An empty ontology has the depth0
.- Specified by:
getDepth
in interfaceGenreOntology
- Returns:
- depth
-
-