Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Semantic Web
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== Example == In the following example, the text "Paul Schuster was born in Dresden" on a website will be annotated, connecting a person with their place of birth. The following [[HTML]] fragment shows how a small graph is being described, in [[RDFa]]-syntax using a [[schema.org]] vocabulary and a [[Wikidata]] ID: <syntaxhighlight lang="html"> <div vocab="https://schema.org/" typeof="Person"> <span property="name">Paul Schuster</span> was born in <span property="birthPlace" typeof="Place" href="https://www.wikidata.org/entity/Q1731"> <span property="name">Dresden</span>. </span> </div> </syntaxhighlight> [[File:RDF example.svg|framed|{{anchor|graph1}}Graph resulting from the RDFa example]]{{clear}} The example defines the following five [[Semantic triple|triples]] (shown in [[Turtle (syntax)|Turtle]] syntax). Each triple represents one edge in the resulting graph: the first element of the triple (the ''subject'') is the name of the node where the edge starts, the second element (the ''predicate'') the type of the edge, and the last and third element (the ''object'') either the name of the node where the edge ends or a literal value (e.g. a text, a number, etc.). <syntaxhighlight lang="turtle"> _:a <https://www.w3.org/1999/02/22-rdf-syntax-ns#type> <https://schema.org/Person> . _:a <https://schema.org/name> "Paul Schuster" . _:a <https://schema.org/birthPlace> <https://www.wikidata.org/entity/Q1731> . <https://www.wikidata.org/entity/Q1731> <https://schema.org/itemtype> <https://schema.org/Place> . <https://www.wikidata.org/entity/Q1731> <https://schema.org/name> "Dresden" . </syntaxhighlight> The triples result in the graph shown in [[#graph1|the given figure]]. [[File:RDF example extended.svg|framed|Graph resulting from the RDFa example, enriched with further data from the Web]] One of the advantages of using [[Uniform Resource Identifier|Uniform Resource Identifiers (URIs)]] is that they can be dereferenced using the [[HTTP]] protocol. According to the so-called [[Linked Open Data]] principles, such a dereferenced URI should result in a document that offers further data about the given URI. In this example, all URIs, both for edges and nodes (e.g. {{code|http://schema.org/Person}}, {{code|http://schema.org/birthPlace}}, {{code|http://www.wikidata.org/entity/Q1731}}) can be dereferenced and will result in further RDF graphs, describing the URI, e.g. that Dresden is a city in Germany, or that a person, in the sense of that URI, can be fictional. The second graph shows the previous example, but now enriched with a few of the triples from the documents that result from dereferencing {{code|https://schema.org/Person}} (green edge) and {{code|https://www.wikidata.org/entity/Q1731}} (blue edges). Additionally to the edges given in the involved documents explicitly, edges can be automatically inferred: the triple <syntaxhighlight lang="turtle"> _:a <https://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://schema.org/Person> . </syntaxhighlight> from the original RDFa fragment and the triple <syntaxhighlight lang="turtle"> <https://schema.org/Person> <http://www.w3.org/2002/07/owl#equivalentClass> <http://xmlns.com/foaf/0.1/Person> . </syntaxhighlight> from the document at {{code|https://schema.org/Person}} (green edge in the figure) allow to infer the following triple, given [[Web Ontology Language|OWL]] semantics (red dashed line in the second Figure): <syntaxhighlight lang="turtle"> _:a <https://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://xmlns.com/foaf/0.1/Person> . </syntaxhighlight>
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)