I am trying to grasp the concept of Semantic Web. I am finding it hard to understand what exactly is the difference between RDF and OWL. Is OWL an extension of RDF or these two are totally different technologies?
相关问题
- How can I optimize a SPARQL query that returns opt
- Calculate the depth of subclass in the OWL ontolog
- MVC2 - Consume RSS feed with RDF and namespace htt
- RDFlib 'on disk' store
- owl:someValuesFrom vs. owl:minCardinalilty
相关文章
- RDF libraries for Scala [closed]
- The difference between blank nodes and variables i
- Triple extraction from a sentance
- Meaning of owl:hasValue?
- boundary for arbitrary property path in SPARQL 1.1
- boundary for arbitrary property path in SPARQL 1.1
- sparql complete tree from subject
- Jena Fuseki assembler file + TDB + OWL reasoner
RDF, RDFS and OWL are means to express increasingly complex information or knowledge. All of them can be serialised in RDF/XML syntax (or any other RDF serialisation syntax like Turtle or N3 for instance).
These technologies are related and supposed to be interoperable, yet they have different origins that's maybe why the relation between them is complicated to grasp. The choice on one or the other depends on how much complexity the situation you are modelling requires.
Summary of expressivity
RDF: Straightforward representation, focused on the instances and on the mapping to their types (
rdf:type
). It is possible to define custom properties to link data and creating triples. RDF data are queried with SPARQL. Example of RDF serialised in Turtle:RDFS: Some situations are not easily modelled by RDF alone, it is sometimes interesting to represent more complex relations like subclasses (the type of a type) for example. RDFS provides special means to represent such cases, with constructs like
rdfs:subClassOf
,rdfs:range
orrdfs:domain
. Ideally, a reasoner can understand the RDFS semantics and expand the number of triples based on the relations: For instance if you have the triplesJohn a Man
andMan rdfs:subClassOf
Human
then you should generate as well the tripleJohn a Human
. Note that this is not possible to do with RDF alone. RDFS data are queried using SPARQL. Example of RDFS serialised in Turtle:OWL: The highest level of expressivity. Relation between classes can be formally modelled based on description logics (mathematical theory). OWL relies heavily on the reasoner, it is possible to express complex constructs such as chained properties for instance or restriction between classes. OWL serves to build ontologies or schema on the top of RDF datasets. As OWL can be serialised as RDF/XML, it is theoretically possible to query it via SPARQL, yet it is much more intuitive to query an OWL ontology with a DL query (which is usually a standard OWL class expression). Example of OWL constructs serialised in Turtle.
When you are using the term RDF you have to distinguish two things:
You can refer to RDF as a concept:
A way of describing things/logic/anything using collections of triples.
Example:
"Anna has apples." "Apples are healthy."
Above you have two triples that describe two resources "Anna" and "apples". The concept of RDF (Resource Description Framework) is that you can describe resources (anything) with sets of only 3 words (terms). At this level you don't care about how you are storing information, whether you have a string of 3 words, or a painting on a wall, or a table with 3 columns etc.
At this conceptual level the only thing that is important is that you can represent anything that you want using triple statements.
You can refer to RDF as a vocabulary
A vocabulary is just a collection of term definitions stored in a file or somewhere. These defined terms have the purpose of being generally reused in other descriptions so people can describe data (resources) more easily and in a standard manner.
On the web you can find some standard vocabularies like:
RDF (https://www.w3.org/1999/02/22-rdf-syntax-ns)
RDFS (https://www.w3.org/2000/01/rdf-schema#)
OWL (https://www.w3.org/2002/07/owl)
The RDF vocubalary defines terms that help you to describe (at the most basic level as possible) individuals/instances of classes. Example: rdf:type, rdf:Property.
With rdf:type you can describe that some resource is an instance of a class:
So the RDF vocabulary has terms that are targeting basic descriptions of class instances and some other descriptions (like the triple statement definition, or the predicate definition... in general things that are realted to the RDF concept).
The RDFS vocabulary has term definitions that help you describe classes and relationships between them. RDFS vocabulary doesn't care about instances of classes (individuals) like the RDF vocabulary. Example: the rdfs:subClassOf property which you can use to describe that a class A is subclass of class B.
The RDF and the RDFS vocabularies are dependent to one another. RDF defines it's terms using RDFS, and RDFS uses RDF for defining it's own terms.
The RDF/RDFS vocabularies provide terms that can be used to create very basic descriptions of resources. If you want to have more complex and accurate descriptions you have to use the OWL vocabulary.
The OWL vocabulary comes with a set of new terms targeting more detailed descriptions. These term are defined using terms from RDF/RDFS vocabularies.
As you can see above the OWL vocabulary extends the concept of rdf:Property by creating new types of Properties that are less abstract and can provide more accurate descriptions of resources.
Conclusions:
In the WC3 document object model, a document is an abstract thing: an element with text, comments, attributes, and other elements nested within it.
In the semantic web, we deal with a set of "triples". Each triple is:
OWL is to the semantic web as Schemas are to the W3C document object model. It documents what the various URIs mean and specify how they are used in a formal way that can be checked by a machine. A semantic web may or may not be valid with respect to the OWL that applies to it, just as a document may or may not be valid with respect to a schema.
RDF is to the semantic web as XML is to the DOM - it's a serialisation of a set of triples.
Of course, RDF is usually serialised as an XML documents ... but it's important to understand that RDF is not the same thing as "the XML serialisation of RDF".
Likewise, OWL can be serialised using OWL/XML, or (sorry about this) it can be expressed as RDF, which itself is usually serialised as XML.
The best answer is to read the book from one of the pioneers of Semantic Web itself "The Semantic Web for working Ontologists", by James Hendler. If you are looking for a quick crash course. Check this udemy course:
https://www.udemy.com/semantic-web/?couponCode=HALFOFF
The semantic web comes in layers. This is a quick summary of the ones I think you're interested in.
Update: Please note that RDFS is used to define the structure of the data, not OWL. OWL describes semantic relationships which normal programming, such as a C struct, isn't fussed about and is closer to AI research & set theory.
Triples & URIs
These describe a single fact. Generally URI's are used for the subject and predicate. The object is either another URI or a literal such as a number or string. Literals can have a type (which is also a URI), and they can also have a language. Yes, this means triples can have up to 5 bits of data!
For example a triple might describe the fact that Charles is Harrys father.
Triples are database normalization taken to a logical extreme. They have the advantage that you can load triples from many sources into one database with no reconfiguration.
RDF and RDFS
The next layer is RDF - The Resource Description Framework. RDF defines some extra structure to triples. The most important thing RDF defines is a predicate called "rdf:type". This is used to say that things are of certain types. Everyone uses rdf:type which makes it very useful.
RDFS (RDF Schema) defines some classes which represent the concept of subjects, objects, predicates etc. This means you can start making statements about classes of thing, and types of relationship. At the most simple level you can state things like http://familyontology.net/1.0#hasFather is a relationship between a person and a person. It also allows you to describe in human readable text the meaning of a relationship or a class. This is a schema. It tells you legal uses of various classes and relationships. It is also used to indicate that a class or property is a sub-type of a more general type. For example "HumanParent" is a subclass of "Person". "Loves" is a sub-class of "Knows".
RDF Serialisations
RDF can be exported in a number of file formats. The most common is RDF+XML but this has some weaknesses.
N3 is a non-XML format which is easier to read, and there's some subsets (Turtle and N-Triples) which are stricter.
It's important to know that RDF is a way of working with triples, NOT the file formats.
XSD
XSD is a namespace mostly used to describe property types, like dates, integers and so forth. It's generally seen in RDF data identifying the specific type of a literal. It's also used in XML schemas, which is a slightly different kettle of fish.
OWL
OWL adds semantics to the schema. It allows you to specify far more about the properties and classes. It is also expressed in triples. For example, it can indicate that "If A isMarriedTo B" then this implies "B isMarriedTo A". Or that if " C isAncestorOf D " and " D isAncestorOf E " then " C isAncestorOf E ". Another useful thing owl adds is the ability to say two things are the same, this is very helpful for joining up data expressed in different schemas. You can say that relationship "sired" in one schema is owl:sameAs "fathered" in some other schema. You can also use it to say two things are the same, such as the "Elvis Presley" on wikipedia is the same one on the BBC. This is very exciting as it means you can start joining up data from multiple sites (this is "Linked Data").
You can also use the OWL to infer implicit facts, such as "C isAncestorOf E".
The basic semantic web stack has been explained a lot already in this thread. I'd like to focus on the initial question and compare RDF to OWL.
Using OWL is essential to get more meaning (reasoning & inference) by just knowing a few facts. This "dynamically created" information can further be used for accordant queries like in SPARQL.
Some examples will show that that actually works with OWL - these have been taken from my talk about the basics of semantic web at the TYPO3camp Mallorca, Spain in 2015.
equivalents by rules
This means that a
Spaniard
must be aPerson
(and thus inherits all properties in the inferencing part) and must live in at least one (or more)SpanishCity
.meaning of properties
The example shows the result of applying
inverseOf
to the propertiesisPartOf
andcontains
.cardinalities of properties
This defines that each
Thing
(in this scenario most probably aHuman
) has exactly two parents - the cardinality is assigned to thehasParent
property.