2

I created this RDF restaurant description...

<rdf:Description rdf:nodeID='Nb925d432-69b1-42e0-8063-d914e3504dde'>
<rdf:type rdf:resource='http://schema.org/Restaurant'/>
<schema:name>Chez Mel</schema:name>
<schema:address>63-65 rue Saint-Vulfran</schema:address>
<schema:telephone>+33 3 22 19 48 64</schema:telephone>
<schema:description>Hearty and family-friendly restaurant.</schema:description>
</rdf:Description>

... by extracting info from the "Abbeville" Wikivoyage article, which itself points to the "Abbeville" Wikidata item.

How can I update the code above to indicate that this restaurant is in that Wikidata geographical entity?

2

What you can do is to create another entity that represents Abbeville, set it as schema:location (or maybe schema:containedIn?) of the restaurant and then use schema:sameAs to link to that Wikidata URI:

<rdf:Description rdf:nodeID='Nb925d432-69b1-42e0-8063-d914e3504dde'>
    <rdf:type rdf:resource='http://schema.org/Restaurant'/>
    <schema:name>Chez Mel</schema:name>
    <schema:address>63-65 rue Saint-Vulfran</schema:address>
    <schema:telephone>+33 3 22 19 48 64</schema:telephone>
    <schema:description>Hearty and family-friendly restaurant.</schema:description>
    <schema:location>
        <rdf:Description rdf:nodeID='NsomeotherGUID'>
            <rdf:type rdf:resource='http://schema.org/City'/>
            <schema:sameAs rdf:resource='https://www.wikidata.org/wiki/Q28520'/>
        </rdf:Description>
    </schema:location>
</rdf:Description>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.