Using Ontology , I want to create a SPARQL query so that I can get all the wines and their properties , as in the table below, consider that I do not know the property names a priori.
vin | rdf:type | vin:hasMaker | vin:hasSugar | ... ========================================================================== ... GaryFarrellMerlot | vin:Merlot | vin:Elyse | vin:Dry | ... -------------------------------------------------------------------------- ElyseZinfandel | vin:Elyse | vin:GaryFarrell | vin:Dry | ... ...
Can someone tell me?
- EDIT
It is not possible to get the result of the query in the format I specified, but I can have it as follows:
vin | property | value ================================================= GaryFarrellMerlot | rdf:type | vin:Merlot ------------------------------------------------- GaryFarrellMerlot | rdf:hasMaker | vin:Elyse ------------------------------------------------- ...
With this selection (thanks cygri ):
SELECT DISTINCT ?wine ?property ?value WHERE { ?o1 a ?class . ?wine a ?o1 . ?wine ?property ?value . }
This will result in wines instead of wines (Merlot → GaryFarrellMerlot). The only problem is the wine, as well as the winery, regions, flavors, etc., and I only wanted wine and its properties. In addition, there is no such attribute vin: Merlot rdfs: subClassOf vin: Wine. Any clues?
ontology sparql sesame
ksiomelo
source share