I'd like to inventory my wine collection using RDF but am not sure how to specify that wine can contain percentages of several grape varietals. Below is an attempt to do so in Turtle syntax using rdf:bag.
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix vin: <http://example.org/wine#> .
<http://example.org/wine/id#1001>
a <http://example.org/wine/ns#red> ;
vin:name "Quilceda Creek CVR" ;
vin:vintage "2014"^^xsd:gYear ;
vin:winery "Quilceda Creek"@en ;
vin:alcoholContent "0.15"^^xsd:decimal ;
vin:agedIn "French Oak"@en ;
vin:varietals rdf:_1, rdf:_2, rdf:_3, rdf:_4, [
a rdf:Bag ;
rdf:_1 "Cabernet Sauvignon"@en ;
rdf:_1 "0.76"^^xsd:decimal ;
rdf:_2 "Merlot"@en ;
rdf:_2 "0.20"^^xsd:decimal ;
rdf:_3 "Petit Verdot"@en ;
rdf:_3 "0.03"^^xsd:decimal ;
rdf:_4 "Malbec"@en ;
rdf:_4 "0.01"^^xsd:decimal ;
] .
When I convert this to XML/RDF, the triples with percentages get dropped. This makes me think you shouldn't/can't use the bag item predicates (ex. rdf:_1) more than once.
I've also considered making a bag of bags, with a bag for each varietal containing the name and percentage. This would involve creating even more blank nodes, which doesn't seem right to me. Eventually I would like to be able to retrieve all wines containing at least a certain percentage of a particular varietal. I'm not sure if I'll be able to if varietal name and percentage pairs have no relationship defined other than being in the same bag.
I'm new to this but have a feeling I need to look to RDF Schemas and ontologies for this problem. That said, I also don't want to jump ship to that until I totally understand why I need to.
If possible, how can RDF be used to represent that a wine has certain percentages of different varietals?