But ask “What can the Web infrastructure provide to improve the consistency and availability of Web data?"
A Connected Web Is a Smarter Web.
“we need a Web infrastructure that lets us connect data to smart Web applications so that the whole Web experience is enhanced. The Web seems smarter because smart applications can get the data they need.
When we speak of “semantics” of natural language, we often refer to something about what it means to understand the utterance—how to go from the structured letters or sounds in a language to some kind of meaning behind them.
-
That is, given that symbols can refer to things in the world, how can we build models from those symbols that help us to capture, understand, and communicate what we know about relationships between those things?
-
In the Semantic Web we refer to the things in the world as resources; a resource can be anything that someone might want to talk about. In this article, we will show examples of things someone might talk about and that can be resources in the SemanticWeb.
With data-backed Web applications, the Semantic Web infrastructure allows the data to drive the presentation so that various webpages (presentations) can provide views into a consistent body of information. In this way, the Semantic Web helps data not be so dumb.
From a technical point of view, the Semantic Web consists primarily of three technical standards(RDF, SPARQL, OWL):
• RDF (Resource Description Framework): The data modeling language for the Semantic Web. All Semantic Web information is stored and represented in the RDF.
• SPARQL (SPARQL Protocol and RDF Query Language): The query language of the Semantic Web. It is specifically designed to query data across various systems.
A Query Language for RDF Graph Traversal (SPARQL Query Language Specification)
A Protocol Layer, to use SPARQL via http (SPARQL Protocol for RDF Specification)
An XML Output Format Specification for SPARQL Queries (SPARQL Query XML Results Format)
• OWL (Web Ontology Language) The schema language, or knowledge representation (KR) language, of the Semantic Web. OWL enables you to define concepts composably so that these concepts can be reused as much and as often as possible. Composability means that each concept is carefully defined so that it can be selected and assembled in various combinations with other concepts as needed for many different applications and purposes.
Subject X is "Harald" and Object(Literal) Y is "++49-331-5509-927", which is “the value of X,” and Predicate, P is “phone”
Subject X is "Harald" and Object(Resource) Y is "http://harald.blogspot.com/", which is “the value of X,” and Predicate, P is “weblog”
• URIs/IRIs in angle brackets
• Literals in quotation marks
• Triple ends with a period
< http://harald.sack.de/foaf.rdf#harald > < http://xmlns.com/foaf/0.1/phone > “+
+49-331-5509-927“ .
< http://harald.sack.de/foaf.rdf#harald > < http://xmlns.com/foaf/0.1/weblog >
< http://harald.blogspot.com/ > .
@prefix foaf: < http://xmlns.com/foaf/0.1 /> .
@base < http://harald.sack.de/foaf.rdf >
<#harald> foaf:phone “++49-331-5509-927“ .
<#harald> foaf:weblog < http://harald.blogspot.com/ > .
- Below "Turtle Notation with ;" has same result with above Trutle Notation : semicolon indicates that subsequent triples have the same subject
@prefix foaf: < http://xmlns.com/foaf/0.1/ > .
@base < http://harald.sack.de/foaf.rdf >
<#harald> foaf:phone “++49-331-5509-527“ ; foaf:weblog < http://semweb2014.blogspot.com/ > .
- comma indicates that subsequent triples have same subject and property (object list)
@prefix foaf: < http://xmlns.com/foaf/0.1/ > .
<#harald> foaf:weblog < http://semweb2014.blogspot.com/ > ,
< http://semweb2013.blogspot.com/ > ,
< http://semweb2012.blogspot.com/ > .
- Typed literal
@prefix lec: < http://hpi-web.de/Lecture# > .
< http://hpi.web.de/Spring14#KE >
lec:name “Knowledge Engineering“^^< http://www.w3c.org/2001/XMLSchema#string > ;
lec:hours “4“^^< http://www.w3c.org/2001/XMLSchema#integer > .
- Anonymous Blank Nodes
@prefix hpi-lv: < http://hpi-web.de/Lecture# >.
< http://hpi-web.de/Spring14#KE > hpi-lv:name "Knowledge Engineering";
hpi-lv:takesPlace [
hpi-lv:date "Tue 13.30-15.00";
hpi-lv:room "HS3" ] .
- Deferencable Blank Nodes
@prefix hpi-lv: < http://hpi-web.de/Lecture# >.
< http://hpi-web.de/Spring14#KE > hpi-lv:name "Knowledge Engineering";
hpi-lv:takesPlace _:ID1 .
_:ID1 hpi-lv:date "Tue 13.30-15.00";
hpi-lv:room "HS3" .
@prefix rdf: < http://www.w3.org/1999/02/22-rdf-syntax-ns# > .
@prefix lv: < http://hpi-web.de/Lecture# > .
@base < http://hpi-web.de/ >.
<Sprint14#KE> lv:hasParticipant [
rdf:first ; rdf:rest [
rdf:first ; rdf:rest [
rdf:first ; rdf:rest [
rdf:first ;
rdf:rest rdf:nil
] ] ] ] .
rdf:Statement defines an RDF Statement, consisting of Subject, Predicate and Object
Sherlock Holmes supposes that the Gardener has killed the Butler
@prefix rdf: < http://www.w3.org/1999/02/22-rdf-syntax-ns# > .
@prefix : < http://example.org/Crimestories# > .
:SherlockHolmes :supposes :StatementOnGardener .
:StatementOnGardener a rdf:Statement ;
rdf:subject :Gardener ;
rdf:predicate :hasKilled ;
rdf:object :Butler .
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#“
xmlns:foaf=“http://xmlns.com/foaf/0.1/“ >
<rdf:Description rdf:about=“http://harald.sack.de/foaf.rdf#harald“>
foaf:phone++49-331-5509-927</foaf:phone>
</rdf:Description>
<rdf:Description rdf:about=“http://harald.sack.de/foaf.rdf#harald“>
foaf:weblog
<rdf:Description rdf:about=“http://haraldblogspot.com/“></rdf:Description>
</foaf:weblog>
</rdf:Description>
</rdf:RDF>
@prefix rdf: < http://www.w3.org/1999/02/22-rdf-syntax-ns# > .
@prefix lv: < http://hpi-web.de/Lecture# > .
@base < http://hpi-web.de/ >.
<Spring14#KE> lv:hasParticipant (
).
• Definition of classes
• Class instantiation in RDF via rdf:type
• Definition of properties and restrictions
• Definition of hierarchies
• Subclasses and superclasses
• Subproperties and superproperties
• rdfs:Class is Concept of a class, defines an abstract object and is applied (with rdf:type) to create instances
• rdf:Propert is Base class for properties
• rdfs:Literal is Class for literals
• rdfs:Resource is every entity of an RDF model is instance of this class
• and additionally,Threre are rdfs:Datatype, rdf:XMLLiteral, rdfs:Container, rdfs:ContainerMembershipProperty in Classes.
• rdfs:subClassOf is transitive property to define inheritance hierarchies for classes
• rdfs:subPropertyOf is transitive property to define inheritance hierarchies for properties
• rdfs:domain is defines the domain of a property concerning a class
• rdfs:range is defines range of a property concerning a class
@prefix rdf: < http://www.w3.org/1999/02/22-rdf-syntax-ns# > .
@prefix rdfs: < http://www.w3.org/2000/01/rdf-schema# > .
@prefix : < http://example.org/ >.
:Lecture a rdfs:Class;
rdfs:subClassOf :Course.
:Seminar a rdfs:Class ;
rdfs:subClassOf :Course.
:Person a rdfs:Class .
:Staff a rdfs:Class ;
rdfs:subClassOf :Person .
:SeniorResearcher a rdfs:Class ;
rdfs:subClassOf :Staff .
:Professor a rdfs:Class ;
rdfs:subClassOf :Staff.
:isManagedBy a rdf:Property ;
rdfs:domain :Course ;
rdfs:range :Staff .
<Spring14#KE> a :Lecture .
:HaraldSack a :SeniorResearcher .
<Spring14#KE> :isManagedBy :HaraldSack .
PREFIX rdf: < http://www.w3.org/1999/02/22-rdf-syntax-ns# >
PREFIX rdfs: < http://www.w3.org/2000/01/rdf-schema# >
PREFIX dbpedia-owl: < http://dbpedia.org/ontology/ >
PREFIX dbpprop: < http://dbpedia.org/property/ >
SELECT ?author ?work ?date
FROM < http://dbpedia.org/ >
WHERE {
?author rdf:type dbpedia-owl:Writer .
?author dbpedia-owl:notableWork ?work .
?work dbpprop:releaseDate ?date
} ORDER BY ?date
LIMIT 100
New variable is assigned using "xsd:integer(?date) AS ?year" in SELECT phrase.
PREFIX rdf: < http://www.w3.org/1999/02/22-rdf-syntax-ns# >
PREFIX rdfs: < http://www.w3.org/2000/01/rdf-schema# >
PREFIX dbpedia-owl: < http://dbpedia.org/ontology/ >
PREFIX dbpprop: < http://dbpedia.org/property/ >
SELECT ?author ?work xsd:integer(?date) AS ?year
FROM < http://dbpedia.org/ >
WHERE {
?author rdf:type dbpedia-owl:Writer .
?author dbpedia-owl:notableWork ?work .
?work dbpprop:releaseDate ?date
} ORDER BY ?date
LIMIT 100
New variable is assigned using "(REPLACE(str(?date),"[^0-9]", "")) AS ?year" in SELECT phrase.
PREFIX rdf: < http://www.w3.org/1999/02/22-rdf-syntax-ns# >
PREFIX rdfs: < http://www.w3.org/2000/01/rdf-schema# >
PREFIX dbpedia-owl: < http://dbpedia.org/ontology/ >
PREFIX dbpprop: < http://dbpedia.org/property/ >
SELECT ?author ?work (REPLACE(str(?date),"[^0-9]", "")) AS ?year
FROM < http://dbpedia.org/ >
WHERE {
?author rdf:type dbpedia-owl:Writer .
?author dbpedia-owl:notableWork ?work .
?work dbpprop:releaseDate ?date
FILTER REGEX (?date, "[0-9]{4}") . } ORDER BY ?date
LIMIT 100
PREFIX rdf: < http://www.w3.org/1999/02/22-rdf-syntax-ns# >
PREFIX dbpedia-owl: < http://dbpedia.org/ontology/ >
SELECT (COUNT(?author)) AS ?num
FROM < http://dbpedia.org/ >
WHERE {
?author rdf:type dbpedia-owl:Writer .
}
Aggregate Functions : (COUNT(DISTINCT ?author))
PREFIX rdf: < http://www.w3.org/1999/02/22-rdf-syntax-ns# >
PREFIX dbpedia-owl: < http://dbpedia.org/ontology/ >
SELECT (COUNT(DISTINCT ?author)) AS ?num
FROM < http://dbpedia.org/ >
WHERE {
?author rdf:type dbpedia-owl:Writer .
?author dbpedia-owl:notableWork ?work .
}
Aggregate Functions : (COUNT(?work)), GROUP BY ?author
PREFIX rdf: < http://www.w3.org/1999/02/22-rdf-syntax-ns# >
PREFIX dbpedia-owl: < http://dbpedia.org/ontology/ >
SELECT ?author (COUNT(?work)) AS ?num_works
FROM < http://dbpedia.org/ >
WHERE {
?author rdf:type dbpedia-owl:Writer .
?author dbpedia-owl:notableWork ?work .
} GROUP BY ?author
ORDER BY DESC (?num_works)
Subqueries :
PREFIX rdf: < http://www.w3.org/1999/02/22-rdf-syntax-ns# >
PREFIX dbpedia-owl: < http://dbpedia.org/ontology/ >
SELECT ?author ?influencer ?work
FROM < http://dbpedia.org/ >
WHERE {
{ SELECT ?author ?influencer
FROM < http://dbpedia.org/ >
WHERE {
?author rdf:type dbpedia-owl:Writer .
?author dbpedia-owl:influencedBy ?influencer .
} LIMIT 10
}
?influencer dbpedia-owl:notableWork ?work .
}
Filtering of query solutions is done within a FILTER expression using NOT EXISTS and EXISTS.
PREFIX rdf: < http://www.w3.org/1999/02/22-rdf-syntax-ns# >
PREFIX dbpedia-owl: < http://dbpedia.org/ontology/ >
SELECT ?author
FROM < http://dbpedia.org/ >
WHERE {
?author rdf:type dbpedia-owl:Writer
FILTER NOT EXISTS {?author dbpedia-owl:notableWork ?work .}
}
Filtering of query solutions be removing possible solutions with MINUS.
PREFIX rdf: < http://www.w3.org/1999/02/22-rdf-syntax-ns# >
PREFIX dbpedia-owl: < http://dbpedia.org/ontology/ >
SELECT ?author
FROM < http://dbpedia.org/ >
WHERE {
?author rdf:type dbpedia-owl:Writer
MINUS {?author dbpedia-owl:notableWork ?work .}
}
A property path is a possible route through an RDF graph between two graph nodes.
• trivial case: property path of length 1, i.e. a triple pattern
• alternatives: match one or both possibilities { :book1 dc:title|rdfs:label ?displayString }
• sequence: property path of length >1
{ ?x foaf:mbox mailto:alice@example .
?x foaf:knows/foaf:knows/foaf:name ?name . }
• inverse property paths: reversing the direction of the triple
{ ?x foaf:mbox mailto:alice@example }
=
{ mailto:alice@example ^foaf:mbox ?x }
• inverse path sequences paths
{ ?x foaf:knows/^foaf:knows ?y .
FILTER(?x != ?y) }
• arbitrary length match
{ ?x foaf:mbox mailto:alice@example .
?x foaf:knows+/foaf:name ?name . }
• inverse path sequences paths { ?x foaf:knows/^foaf:knows ?y . FILTER(?x != ?y) }
• arbitrary length match { ?x foaf:mbox mailto:alice@example . ?x foaf:knows+/foaf:name ?name . }
• negated property paths { ?x !(rdf:type|^rdf:type) ?y }
PREFIX : < http://dbpedia.org/resource/ >
PREFIX rdf: < http://www.w3.org/1999/02/22-rdf-syntax-ns# >
PREFIX dbpedia-owl: < http://dbpedia.org/ontology/ >
SELECT ?influencedByInfluencers
FROM < http://dbpedia.org/ >
WHERE {
:George_Orwell
dbpedia-owl:influencedBy/^dbpedia-owl:influencedBy
?influencedByInfluencers .
}
RDF data can be encoded with semantic metadata using two syntaxes: RDFS(RDF Schema) and OWL.
Ontology classifies things in terms of semantics, or meaning into class or subclass, which allow us to define contextual relationship behind a defined vocabulary.
OWL is the formal syntax for defining ontologies and it is extension of RDFS(RDF Schema)
• Classes : comparable with classes in RDFS
• Individuals : comparable with objects in RDFS
• Properties : comparable with properties in RDFS
1.OWL – Classes
• there exist two predefined classes(owl:Thing, owl:Nothing)
owl:Thing (class that contains all individuals)
owl:Nothing (empty class)
• Definition of a class
:Book a owl:Class .
2.OWL – Individuals
• Definition of individuals via class membership(a "NineteenEightyfour" Book instance generated)
:NineteenEightyfour a :Book .
• Individuals can also be defined without direct class membership as named entity
:HaraldSack a owl:NamedIndividual .
3.OWL – Properties
There exist two property variants: object properties and datatype properties
• Object properties are defined like classes
:author a owl:ObjectProperty .
• Domain and Range of object properties
:author a owl:ObjectProperty ;
rdfs:domain :Book ;
rdfs:range :Writer .
• Datatype properties have datatypes as range
:publicationYear a owl:DatatypeProperty .
•Domain and range of datatype properties
:publicationYear a owl:DatatypeProperty ;
rdfs:domain :Book ;
rdfs:range xsd:integer .
• OWL – Properties and Individuals
:Book a owl:Class .
:Writer a owl:Class .
:GeorgeOrwell a Writer .
:author a owl:ObjectProperty ;
rdfs:domain :Book ;
rdfs:range :Writer .
:publicationYear a owl:DatatypeProperty ;
rdfs:domain :Book ;
rdfs:range xsd:integer .
:NineteenEightyFour a :Book ;
:author :GeorgeOrwell ;
:publicationYear 1948 .
• OWL – • Properties in general are not functional
:Genre a owl:Class .
:PoliticalFiction a :Genre .
:ScienceFiction a :Genre .
:DystopianFiction a :Genre .
:literaryGenre a owl:ObjectProperty ;
rdfs:domain :Book ;
rdfs:range :Genre .
:NineteenEightyFour a :Book ;
:literaryGenre :PoliticalFiction ;
:literaryGenre :ScienceFiction ;
:literaryGenre :DystopianFiction .
• OWL – Class Hierarchies
via inference it can be entailed that „Novel“ is also a subclass of „Work“
:Novel a owl:Class ;
rdfs:subClassOf :Book .
:Book a owl:Class ;
rdfs:subClassOf :Work .
:Work a owl:Class .
• OWL – Class Hierarchies and Disjunctiveness
via inference it can be entailed that „Novel“ and „Poet“ are also disjoint classes.
:Book a owl:Class .
:Writer a owl:Class .
:Novel a owl:Class ;
rdfs:subClassOf :Book .
:Poet a owl:Class ;
rdfs:subClassOf :Work .
:Book owl:disjointWith :Writer .
• OWL – Class Hierarchies and Disjunctiveness
OWL provides a shortcut to define several classes to be disjunctive.
[] a owl:AllDisjointClasses ;
owl:members.
( :Book
:Poet a owl:Class ;
:Writer
:Vegetable
:Furniture
:Car ) .
• OWL – Class Hierarchies and Equivalence
via inference it can be entailed that „Poet“ is also an „Author“
:Writer a owl:Class .
:Author a owl:Class .
:Poet a owl:Class ;
rdfs:subClassOf :Writer .
:Writer owl:equivalentClass :Author .
• OWL – Individuals
via inference it can be entailed that „ARX012345“ is a „Book“
:NineteenEightyfour a :Novel ;
:author :GeorgeOrwell ;
:publicationYear 1948 ;
owl:sameAs :ARX012345 .
:Novel a owl:Class ;
rdfs:subClassOf :Book .
:Book a owl:Class.
• Difference of Individuals via owl:differentFrom
:ARX012345 a :Novel ;
owl:differentFrom :ARX012346 .
• OWL – Individuals
OWL provides a shortcut to define several individuals to be different
owl:AllDifferent ;
owl:distinctMembers
(:NineteenEightyfour :AnimalFarm.
:BraveNewWorld.
:Simulacron5) .
@prefix : < http://example.com/owl/ > .
@prefix owl: < http://www.w3.org/2002/07/owl# > .
@prefix rdfs: < http://www.w3.org/2000/01/rdf-schema# > .
@prefix rdf: < http://www.w3.org/1999/02/22-rdf-syntax-ns# > .
@prefix xsd: < http://www.w3.org/2001/XMLSchema# > .
:HappyPerson a owl:Class ;
owl:equivalentClass [
a owl:Class ;
owl:intersectionOf ([ a owl:Restriction ;
owl:onProperty :hasChild ;
owl:allValuesFrom :HappyPerson ]
[ a owl:Restriction ;
owl:onProperty :hasChild ;
owl:someValuesFrom :HappyPerson ]
)
].
Acknowledgement : Some images and articles are from other sites or materials: Amelie Gyrard: Christian Bonnet (Eurecom, Mobile Communication),Dr. Harald Sack : Hasso-Plattner-Institut for IT Systems Engineering, Dean Allemang : Semantic Web for the Working Ontologist
Yoonsu Park - http://www.patternics.com Distributed under the MIT license. See LICENSE for more information( https://en.wikipedia.org/wiki/MIT_License ). https://github.com/blockchain99/SemanticWeb