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
Resource Description Framework
(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!
==RDF topics== ===Vocabulary=== The vocabulary defined by the RDF specification is as follows:<ref name="rdfschema">{{cite web|url=http://www.w3.org/TR/rdf-schema/|title=RDF Vocabulary Description Language 1.0: RDF Schema|publisher=[[W3C]]|date=2004-02-10|access-date=2011-01-05}}</ref> ====Classes==== ===== rdf ===== ; {{code|rdf:XMLLiteral}} : the class of XML literal values ; {{code|rdf:Property}} : the class of properties ; {{code|rdf:Statement}} : the class of RDF statements ; {{code|rdf:Alt}}, {{code|rdf:Bag}}, {{code|rdf:Seq}} : containers of alternatives, unordered containers, and ordered containers (<code>rdfs:Container</code> is a super-class of the three) ; {{code|rdf:List}} : the class of RDF Lists ; {{code|rdf:nil}} : an instance of <code>rdf:List</code> representing the empty list ===== rdfs ===== ; {{code|rdfs:Resource}} : the class resource, everything ; {{code|rdfs:Literal}} : the class of literal values, e.g. [[string literal|string]]s and [[integer]]s ; {{code|rdfs:Class}} : the class of classes ; {{code|rdfs:Datatype}} : the class of RDF datatypes ; {{code|rdfs:Container}} : the class of RDF containers ; {{code|rdfs:ContainerMembershipProperty}} : the class of container membership properties, <code>rdf:_1</code>, <code>rdf:_2</code>, ..., all of which are sub-properties of <code>rdfs:member</code> ====Properties==== =====rdf===== ; {{code|rdf:type}} : an instance of <code>rdf:Property</code> used to state that a resource is an instance of a class ; {{code|rdf:first}} : the first item in the subject RDF list ; {{code|rdf:rest}} : the rest of the subject RDF list after <code>rdf:first</code> ; {{code|rdf:value}} : idiomatic property used for structured values ; {{code|rdf:subject}} : the subject of the RDF statement ; {{code|rdf:predicate}} : the predicate of the RDF statement ; {{code|rdf:object}} : the object of the RDF statement <code>rdf:Statement</code>, <code>rdf:subject</code>, <code>rdf:predicate</code>, <code>rdf:object</code> are used for [[reification (knowledge representation)|reification]] (see [[#Statement reification and context|below]]). =====rdfs===== ; {{code|rdfs:subClassOf}} : the subject is a subclass of a class ; {{code|rdfs:subPropertyOf}} : the subject is a subproperty of a property ; {{code|rdfs:domain}} : a domain of the subject property ; {{code|rdfs:range}} : a range of the subject property ; {{code|rdfs:label}} : a human-readable name for the subject ; {{code|rdfs:comment}} : a description of the subject resource ; {{code|rdfs:member}} : a member of the subject resource ; {{code|rdfs:seeAlso}} : further information about the subject resource ; {{code|rdfs:isDefinedBy}} : the definition of the subject resource This vocabulary is used as a foundation for [[RDF Schema]], where it is extended. === Serialization formats === {{Infobox file format | name = RDF 1.1 Turtle serialization | icon = | extension = .ttl | mime = text/turtle<ref>{{cite web |url=http://www.w3.org/TR/turtle/#h2_sec-mediaReg |title=RDF 1.1 Turtle: Terse RDF Triple Language |publisher=W3C |date=9 Jan 2014 |access-date=2014-02-22}}</ref> | owner = [[World Wide Web Consortium]] | standard = [http://www.w3.org/TR/turtle/ RDF 1.1 Turtle: Terse RDF Triple Language] {{start date and age|2014|01|09}} | open = Yes }} {{Infobox file format | name = RDF 1.1 TriG serialization | icon = | extension = .trig | mime = application/trig<ref>{{cite web |url=http://www.w3.org/TR/trig/#h2_sec-mediaReg |title=RDF 1.1 TriG: RDF Dataset Language |publisher=W3C |date=25 Feb 2014 |access-date=2022-12-21}}</ref> | owner = [[World Wide Web Consortium]] | standard = [http://www.w3.org/TR/trig/ RDF 1.1 TriG: RDF Dataset Language] {{start date and age|2014|02|25}} | open = Yes }} {{Infobox file format | name = RDF/XML serialization | icon = [[Image:XML.svg|100px]] | extension = .rdf | mime = application/rdf+xml<ref>{{cite news |url=http://tools.ietf.org/html/rfc3870 |title=application/rdf+xml Media Type Registration |newspaper=Ietf Datatracker |page=2 |publisher=IETF |date=September 2004 |access-date=2011-01-08}}</ref> | owner = [[World Wide Web Consortium]] | standard = [http://www.w3.org/TR/2004/REC-rdf-concepts-20040210/ Concepts and Abstract Syntax] {{start date and age|2004|02|10}} | open = Yes }} Several common [[Serialization|serialization formats]] are in use, including: * '''[[Turtle (syntax)|Turtle]],'''<ref name="turtle">{{cite web |title=RDF 1.1 Turtle: Terse RDF Triple Language |url=http://www.w3.org/TR/turtle/ |date=9 January 2014 |publisher=W3C }}</ref> a compact, human-friendly format. * '''[[TriG (syntax)|TriG]],'''<ref name="trig">{{cite web |title=RDF 1.1 TriG: RDF Dataset Language |url=http://www.w3.org/TR/trig/ |date=25 February 2014 |publisher=W3C }}</ref> an extension of Turtle to datasets. * '''[[N-Triples]],'''<ref name="n-triples" >{{cite web |title=RDF 1.1 N-Triples: A line-based syntax for an RDF graph |date=9 January 2014 |url=http://www.w3.org/TR/n-triples/ |publisher=[[W3C]] }}</ref> a very simple, easy-to-parse, line-based format that is not as compact as Turtle. * '''[[N-Quads]],'''<ref>{{cite web |title = N-Quads: Extending N-Triples with Context |date = 2012-06-25 |url = http://sw.deri.org/2008/07/n-quads/ |url-status = dead |archive-url = https://web.archive.org/web/20130426135418/http://sw.deri.org/2008/07/n-quads/ |archive-date = 2013-04-26 }}</ref><ref name="n-quads" >{{cite web |title=RDF 1.1 N-Quads |date=January 2014 |url=http://www.w3.org/TR/n-quads/ |publisher=[[W3C]] }}</ref> a superset of N-Triples, for serializing multiple RDF graphs. * '''[[JSON-LD]],'''<ref name="json-ld">{{cite web|title=JSON-LD 1.0: A JSON-based Serialization for Linked Data|url=http://www.w3.org/TR/json-ld/|publisher=W3C}}</ref> a [[JSON]]-based serialization. * '''N3''' or [[Notation3]], a non-standard serialization that is very similar to Turtle, but has some additional features, such as the ability to define inference rules. * '''[[RDF/XML]]''',<ref name="rdf-xml" >{{cite web |title=RDF 1.1 XML Syntax |date=25 February 2014 |url=http://www.w3.org/TR/rdf-syntax-grammar/ |publisher=[[W3C]] }}</ref> an XML-based syntax that was the first standard format for serializing RDF. * '''RDF/JSON''',<ref name="rdf-json" >{{cite web |title=RDF 1.1 JSON Alternate Serialization (RDF/JSON) |date=7 November 2013 |url=https://www.w3.org/TR/rdf-json/ |publisher=[[W3C]] }}</ref> an alternative syntax for expressing RDF triples using a simple JSON notation. RDF/XML is sometimes misleadingly called simply RDF because it was introduced among the other W3C specifications defining RDF and it was historically the first W3C standard RDF serialization format. However, it is important to distinguish the RDF/XML format from the abstract RDF model itself. Although the RDF/XML format is still in use, other RDF serializations are now preferred by many RDF users, both because they are more human-friendly,<ref name="rdf-xml-syntax-criticism">{{cite web|title=Problems of the RDF syntax|url=http://milicicvuk.com/blog/2011/07/21/problems-of-the-rdf-syntax/|publisher=Vuk Miličić}}</ref> and because some RDF graphs are not representable in RDF/XML due to restrictions on the syntax of XML [[QName]]s. With a little effort, virtually any arbitrary [[XML]] may also be interpreted as RDF using [[GRDDL]] (pronounced 'griddle'), Gleaning Resource Descriptions from Dialects of Languages. RDF triples may be stored in a type of database called a [[triplestore]]. === Resource identification === The subject of an RDF statement is either a [[uniform resource identifier]] (URI) or a [[blank node]], both of which denote [[web resource|resource]]s. Resources indicated by [[blank node]]s are called anonymous resources. They are not directly identifiable from the RDF statement. The predicate is a URI which also indicates a resource, representing a relationship. The object is a URI, blank node or a [[Unicode]] [[string literal]]. As of RDF 1.1 resources are identified by [[Internationalized Resource Identifier]]s (IRIs); IRI are a generalization of URI.<ref>{{Cite web |date=25 February 2014 |title=RDF 1.1 Concepts and Abstract Syntax |url=https://www.w3.org/TR/rdf11-concepts/ |url-status=live |archive-url=https://web.archive.org/web/20240114081050/https://www.w3.org/TR/rdf11-concepts/ |archive-date=Jan 14, 2024 |website=W3C}}</ref> In Semantic Web applications, and in relatively popular applications of RDF like [[RSS (file format)|RSS]] and [[FOAF (software)|FOAF]] (Friend of a Friend), resources tend to be represented by URIs that intentionally denote, and can be used to access, actual data on the World Wide Web. But RDF, in general, is not limited to the description of Internet-based resources. In fact, the URI that names a resource does not have to be dereferenceable at all. For example, a URI that begins with "http:" and is used as the subject of an RDF statement does not necessarily have to represent a resource that is accessible via [[HTTP]], nor does it need to represent a tangible, network-accessible resource—such a URI could represent absolutely anything. However, there is broad agreement that a bare URI (without a # symbol) which returns a 300-level coded response when used in an HTTP GET request should be treated as denoting the internet resource that it succeeds in accessing. Therefore, producers and consumers of RDF statements must agree on the semantics of resource identifiers. Such agreement is not inherent to RDF itself, although there are some controlled vocabularies in common use, such as Dublin Core Metadata, which is partially mapped to a URI space for use in RDF. The intent of publishing RDF-based ontologies on the Web is often to establish, or circumscribe, the intended meanings of the resource identifiers used to express data in RDF. For example, the URI: {{pre|<nowiki>http://www.w3.org/TR/2004/REC-owl-guide-20040210/wine#Merlot</nowiki>}} is intended by its owners to refer to the class of all [[Merlot]] red wines by vintner (i.e., instances of the above URI each represent the class of all wine produced by a single vintner), a definition which is expressed by the OWL ontology—itself an RDF document—in which it occurs. Without careful analysis of the definition, one might erroneously conclude that an instance of the above URI was something physical, instead of a type of wine. Note that this is not a 'bare' resource identifier, but is rather a [[Uniform Resource Identifier#URI references|URI reference]], containing the '#' character and ending with a [[fragment identifier]]. === Statement reification and context === [[Image:Basic RDF Graph.svg|thumb|Basic RDF triple comprising (subject, predicate, object).]] The body of knowledge modeled by a collection of statements may be subjected to [[Reification (knowledge representation)|reification]], in which each ''statement'' (that is each triple ''subject-predicate-object'' altogether) is assigned a URI and treated as a resource about which additional statements can be made, as in "''Jane says that'' John is the author of document X". Reification is sometimes important in order to deduce a level of confidence or degree of usefulness for each statement. In a reified RDF database, each original statement, being a resource, itself, most likely has at least three additional statements made about it: one to assert that its subject is some resource, one to assert that its predicate is some resource, and one to assert that its object is some resource or literal. More statements about the original statement may also exist, depending on the application's needs. Borrowing from concepts available in [[logic]] (and as illustrated in graphical notations such as [[conceptual graphs]] and [[topic map]]s), some RDF model implementations acknowledge that it is sometimes useful to group statements according to different criteria, called ''situations'', ''contexts'', or ''scopes'', as discussed in articles by RDF specification co-editor [[Graham Klyne]].<ref>{{cite web|url=http://www.ninebynine.org/RDFNotes/RDFContexts.html|title=Contexts for Information Modelling in RDF|first=Graham|last=Klyne|website=ninebynine.org}}</ref><ref>{{cite web|url=http://www.ninebynine.org/RDFNotes/UsingContextsWithRDF.html|title=RDF Contexts - provenance and partial knowledge|website=ninebynine.org |date=March 13, 2002 |first1=Graham |last1=Klyne |url-status=live |archive-url=https://web.archive.org/web/20230729162843/http://www.ninebynine.org/RDFNotes/UsingContextsWithRDF.html |archive-date= Jul 29, 2023 }}</ref> For example, a statement can be associated with a context, named by a URI, in order to assert an "is true in" relationship. As another example, it is sometimes convenient to group statements by their source, which can be identified by a URI, such as the URI of a particular RDF/XML document. Then, when updates are made to the source, corresponding statements can be changed in the model, as well. Implementation of scopes does not necessarily require fully reified statements. Some implementations allow a single scope identifier to be associated with a statement that has not been assigned a URI, itself.<ref>{{cite web|url=http://uche.ogbuji.net/tech/akara/nodes/2003-01-01/scopes|title=The concept of 4Suite RDF scopes |website=Uche Ogbuji |url-status=dead |archive-url= https://web.archive.org/web/20081208114927/http://uche.ogbuji.net/tech/akara/nodes/2003-01-01/scopes |archive-date= Dec 8, 2008 }}</ref><ref>{{cite web|url=http://librdf.org/notes/contexts.html|title=Redland Notes - Contexts|website=Redland RDF Libraries |date=2004 |url-status=live |archive-url= https://web.archive.org/web/20230729162841/https://librdf.org/notes/contexts.html |archive-date= Jul 29, 2023 }}</ref> Likewise ''named graphs'' in which a set of triples is named by a URI can represent context without the need to reify the triples.<ref>{{cite web|url=http://www.w3.org/2004/03/trix/|title=Named Graphs / Semantic Web Interest Group|website=W3C |url-status=live |archive-url=https://web.archive.org/web/20231001045448/https://www.w3.org/2004/03/trix/ |archive-date= Oct 1, 2023 }}</ref> === Query and inference languages === {{main|RDF query language}} The predominant query language for RDF graphs is [[SPARQL]]. SPARQL is an [[SQL]]-like language, and a [[W3C recommendation|recommendation]] of the [[W3C]] as of January 15, 2008. The following is an example of a SPARQL query to show country capitals in Africa, using a fictional ontology: <syntaxhighlight lang="sparql"> PREFIX ex: <http://example.com/exampleOntology#> SELECT ?capital ?country WHERE { ?x ex:cityname ?capital ; ex:isCapitalOf ?y . ?y ex:countryname ?country ; ex:isInContinent ex:Africa . } </syntaxhighlight> Other non-standard ways to query RDF graphs include: * [[RDQL]], precursor to SPARQL, SQL-like * Versa, compact syntax (non–SQL-like), solely implemented in [[4Suite]] ([[Python (programming language)|Python]]). * RQL, one of the first declarative languages for uniformly querying RDF schemas and resource descriptions, implemented in RDFSuite.<ref name=RQL>{{cite web|title=The RDF Query Language (RQL)|url=http://139.91.183.30:9090/RDF/RQL/index.html|website=The ICS-FORTH RDFSuite|publisher=ICS-FORTH|access-date=2011-03-29|archive-date=2016-03-05|archive-url=https://web.archive.org/web/20160305224708/http://139.91.183.30:9090/RDF/RQL/index.html|url-status=dead}}</ref> * [[SeRQL]], part of [[Sesame (framework)|Sesame]] * [[XUL]] has a template element in which to declare rules for matching data in RDF. XUL uses RDF extensively for data binding. SHACL Advanced Features specification<ref name="shacl-advanced-feats">{{Cite web|url=https://www.w3.org/TR/shacl-af/|title=SHACL Advanced Features|editor-first1=Holger |editor-last1=Knublauch|editor-first2=Dean|editor-last2=Allemang|editor-first3=Simon|editor-last3=Steyskal|publisher=RDF Data Shapes Working Group |publication-date=2017-06-08|access-date=2021-04-06|website=W3C|date=8 June 2017 }}</ref> (W3C Working Group Note), the most recent version of which is maintained by the SHACL Community Group,<ref>{{Cite web |url=https://w3c.github.io/shacl/shacl-af/ |title=SHACL Advanced Features 1.1 |access-date=2025-03-11}}</ref> defines support for SHACL Rules, used for data transformations, inferences and mappings of RDF based on SHACL shapes. === Validation and description === {{main|RDF query language}} The predominant language for describing and validating RDF graphs is [[SHACL]] (Shapes Constraint Language).<ref>[https://www.w3.org/TR/shacl/] SHACL Specification</ref> SHACL specification is divided in two parts: SHACL Core and SHACL-SPARQL. SHACL Core consists of a list of built-in constraints such as cardinality, range of values and many others. SHACL-SPARQL describes SPARQL-based constraints and an extension mechanism to declare new constraint components. Other non-standard ways to describe and validate RDF graphs include: * [[SPARQL Inferencing Notation]] (SPIN)<ref>[https://spinrdf.org/] SPIN website</ref> was based on SPARQL queries. It has been effectively deprecated in favor of SHACL.<ref>[https://spinrdf.org/spin-shacl.html] Comparison of SHACL with SPIN</ref> * [[ShEx]] (Shape Expressions)<ref>[http://shex.io/shex-semantics/index.html] ShEx Specification</ref> is a concise language for RDF validation and description.
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)