# Vocabularies

# External vocabularies
WD = RDF::Vocabulary.new('http://www.wikidata.org/entity/')
WDT = RDF::Vocabulary.new('http://www.wikidata.org/prop/direct/')
GEO = RDF::Vocabulary.new('http://sws.geonames.org/')
RDFS = RDF::Vocabulary.new('http://www.w3.org/2000/01/rdf-schema#')
SCHEMA = RDF::Vocabulary.new('https://schema.org/')
SKOS = RDF::Vocabulary.new('http://www.w3.org/2004/02/skos/core#')
XSD = RDF::Vocabulary.new('http://www.w3.org/2001/XMLSchema#')

# Internal vocabularies
COUNTRY = RDF::Vocabulary.new('https://daniel.degu.cl/data/theater-migrants/countries.ttl#Country-')
TM = RDF::Vocabulary.new('https://daniel.degu.cl/data/theather-migrants/ontology.ttl#')
PERSON = RDF::Vocabulary.new('https://daniel.degu.cl/data/theater-migrants/persons.ttl#')
LOCATION = RDF::Vocabulary.new('https://daniel.degu.cl/data/theater-migrants/locations.ttl#')
OCCUPATION = RDF::Vocabulary.new('https://daniel.degu.cl/data/theater-migrants/occupations.ttl#')
MIGRATION = RDF::Vocabulary.new('https://daniel.degu.cl/data/theater-migrants/migrations.ttl#')
ORGANISATION = RDF::Vocabulary.new('https://daniel.degu.cl/data/theater-migrants/organisations.ttl#')
PERSONNAME = RDF::Vocabulary.new('https://daniel.degu.cl/data/theater-migrants/personnames.ttl#')
PERSON_OCCUPATION = RDF::Vocabulary.new('https://daniel.degu.cl/data/theater-migrants/person_occupations.ttl#')
REGION = RDF::Vocabulary.new('https://daniel.degu.cl/data/theater-migrants/regions.ttl#')
RELATIONSHIP = RDF::Vocabulary.new('https://daniel.degu.cl/data/theater-migrants/relationships.ttl#')
RELIGION = RDF::Vocabulary.new('https://daniel.degu.cl/data/theater-migrants/religions.ttl#')
WORK = RDF::Vocabulary.new('https://daniel.degu.cl/data/theater-migrants/works.ttl#')

# Mapping from symbols to prefixes
PREFIXES = {
  wd: WD,
  wdt: WDT,
  geo: GEO,
  rdfs: RDFS,
  schema: SCHEMA,
  country: COUNTRY,
  tm: TM,
  person: PERSON,
  location: LOCATION,
  migration: MIGRATION,
  occupation: OCCUPATION,
  organisation: ORGANISATION,
  personname: PERSONNAME,
  personOccupation: PERSON_OCCUPATION,
  region: REGION,
  relationship: RELATIONSHIP,
  religion: RELIGION,
  skos: SKOS,
  work: WORK,
  xsd: XSD
}

# Generates a RDF/Turtle encoded list of prefixes useing the namespace symbols
def prefixes(*namespaces)
  namespaces.sort.map do |ns|
    "@prefix #{ns}: <#{PREFIXES[ns]}> .\n"
  end.join
end
