I am trying to build a dataset from DBpedia, but I am not super familiar with SPARQL. I think I need to do two things:
Given an entity, I want to find all the dbc (categories) to which it belongs. E.g. in the page for Effiel Tower, you can see that there are 12 of them.
In the opposite direction, given a dbc, e.g. Landmarks in France, I want to get all the subjects (instances) in the "is subject of" box.
I have looked through some other posts like post 1 and post 2, but was unable to apply them to my problems, especially the second problem. I would like some help with writing the SPARQL queries. Thank you!
SELECT * { dbr:Eiffel_Tower dct:subject ?category }
SELECT * { ?resource dct:subject dbc:Landmarks_in_France }
The example on this page shows how to run SPARQL queries against DBpedia in Python.