2

I have a quite simple query to find all the museums (museum, abstract) that have at least 1 artwork.

It works fine.

I would like to have the Abstract in various languages... how can i solve it?

Here the very simple query:

SELECT  ?museum ?abstract   WHERE {  
?museum <http://dbpedia.org/ontology/abstract> ?abstract. 
?museum a <http://dbpedia.org/ontology/Museum>.
?artwork <http://dbpedia.org/ontology/location> ?museum.
}

Now the result is :

NameX -- Description in Italian

i would like to have:

NameX -- Description in Italian -- Decription in English -- Decription in french -- Decription in deutsch

Thanks all

Maurizio

2 Answers2

1

I think you will end up defining every bit of code separately. This is my attempt:

SELECT  ?museum ?EnglishAbstract ?ItalianAbstract ?FrenchAbstract
WHERE { 
    ?museum dbpedia-owl:abstract ?EnglishAbstract. 
    ?museum a dbpedia-owl:Museum.
    ?artwork dbpedia-owl:location ?museum.
filter(lang(?EnglishAbstract)='en')

optional{
    ?museum dbpedia-owl:abstract ?ItalianAbstract. 
    ?museum a dbpedia-owl:Museum.
    ?artwork dbpedia-owl:location ?museum.
filter(lang(?ItalianAbstract)='it')
}

optional{
    ?museum dbpedia-owl:abstract ?FrenchAbstract. 
    ?museum a dbpedia-owl:Museum.
    ?artwork dbpedia-owl:location ?museum.
filter(lang(?FrenchAbstract)='fr')
}
}
Artemis
  • 3,271
  • 2
  • 20
  • 33
  • 1
    Ok that's a incredibly good start, but i would like to have each result (each for every language i choose) in the same row for a museum: For example Name_of_museum - description_ita - description_eng - description_deu ... – cataciandevil81 Jul 06 '15 at 12:24
  • I don't think there is a way apart from actually specifying the language of every abstract separately. – Artemis Jul 06 '15 at 12:32
  • Ok, that's it. I supposed to specify that separately. Thanks a lot. – cataciandevil81 Jul 06 '15 at 13:01
  • Ok i've seen a particularity: your query can be resolved only beacause on the international endpoint they have installed also the "canonized" dataset (that's not documentated). i'm looking for a most general solution, using the "owl:sameAs" i made a "not so good but useful to explicate" query: SELECT ?obj WHERE { dbpedia:Moma (owl:sameAs|^owl:sameAs) ?obj } Ok, i would like fo find with the sameAs not only the Moma museum, but all the museums with the abstract for each in the same row... – cataciandevil81 Jul 08 '15 at 07:20
  • I'm not getting what is exactly the problem. You should edit your question with the new problem and then maybe I'll understand better. – Artemis Jul 08 '15 at 17:48
0

You can use the in statement.

SELECT  ?museum ?abstract
WHERE {  
    ?museum <http://dbpedia.org/ontology/abstract> ?abstract. 
    ?museum a <http://dbpedia.org/ontology/Museum>.
    ?artwork <http://dbpedia.org/ontology/location> ?museum.

    filter(lang(?abstract) in ('en', 'it', 'fr'))
}
César R.
  • 31
  • 4