RDF, RDFa and RDFS Flashcards

(257 cards)

1
Q

Why do we need a semantic web and ontologies?

A
  • Web content is too diverse/scattered to be easily found, integrated and aggregated
  • adding machine processable semantics improves search, query answering and knowledge aggregation
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

How are facts modelled?

A

As statements with the structure: Subject - Predicate - Object

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What are Knowledge Graphs (KGs)?

A

They provide an intuitive, yet powerful way to combine complex data, background knowledge about a topic and common sense knowledge about the world.
- They model things that are obvious to humans but unknown/ambiguous to machines/software

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Why is Computer Automation for activities like querying search results tricky?

How can this be solved?

A

Because the web doesn’t have semantics, thus computers/software doesn’t have the same knowledge of dependencies, constraints or context.

By annotating data in a way that software can understand it’s context (alone and within an interconnected network of data)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Which type of formats promote standardisation of the web?

A

HTML and XML

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

How can we provide better search query results to users?

A

By creating large networks of data points that are not siloed to human users but can be combined

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

How can we help a computer recognise information in a web page for example?

A

By embedding annotations such as “Page title”, “what the page is about” and “keynote speakers” into the html to reference concepts that the software can understand

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is the semantic web?

A

A web of partially connected/distributed vocabularies (ontologies) and knowledge bases
- facts are scattered in many locations, with the ability for related instances /ontology fragments asserted anywhere
- Scope and association is managed through namespaces
- references to ontologies and instances through URIs

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What advantage does the semantic web offer?

A

Improves retrieval by using intelligent techniques to take advantage of machine-processable annotations (can use autonomous software agents to perform querying)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What does it mean that the semantic web is a dynamic knowledge source?

A

It’s typically:
- Inconsistent
- Incomplete (open-world assumption)
- Composed of several ontologies
- Generated by novices and machines as well as experts

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is the AAA principle of the semantic web?

What is a downfall of the AAA principle?

A

Anyone can say Anything about Anything
- any individual can assert data about some entity (foundation for RDF design)

It causes issues of maintenance, trustability and veracity

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Why is it important to remember that information in the semantic web is distributed, networked, disparate and maybe inconsistent?

What is the open world assumption?

A
  • The open world assumption means we can’t assume we have all the information in the network or that we know everything that has been asserted about one single topic.
  • If a query doesn’t produce a result, it doesn’t mean the answer doesn’t exist. It implies it could exist but a meaningful link is yet to be established.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is the issue with data represented in a tabular form?

A
  • It has limited search ability, we can only search by row, column or cell. Each method loses necessary context producing problems.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

How can XML be used as a data exchange mechanism?

Explain why XML is not the solution for providing semantics:

A

It consists of components:
Syntax: how to write the data
Data model: how to organise the data
Semantics: how to interpret the data

This is not the solution because there’s no unique way to express the same information. Tag names do not necessarily provide semantics.
- XML makes no commitment to domain specific ontological vocabulary or modelling
- it’s feasible for closed collaboration but not suitable for global use

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What does RDF stand for and what is it?

A

Resource Description Framework is a language for describing metadata on the web (helps create the semantic web)

  • it provides a graph data model that formally describes semantics
  • models resource metadata on the web using subject-predicate-object triples
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is an RDF triple?

A

A triple defines the relationship or predicate between two entities (a subject and an object).
- It is a fact or a statement

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

Describe the RDF data model (and why this is advantageous)?

A
  • Uses a graph (not a table)
  • it is domain independent and can be distributed in a seamless way
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

Describe what semantics and syntax are:

A
  • Semantics are a set of rules for how to interpret the data model. They describe interpretations of the data items with respect to the domain
  • Syntax is a standardised exchange format
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

What is Schema.org an example of?

A

A specific format for semantics.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

What is the role of models?

A

They are abstractions that help people understand a fragment of the world and assembles knowledge. They may hide some details and spotlight others.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

What are the use cases of models?

A
  • They help people communicate ideas
  • They explain and make predictions
  • They mediate among multiple viewpoints
  • They represent commonalities
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

Describe the building blocks of RDF:

A

RDF graphs can be one statement or multiple. They consist of:
- Statements, resources and properties

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

Describe RDF statements

A

RDF Statements are subject-predicate-object triples.

They assert the properties of a resource, in the form: resource, property, value.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

What are valid objects?

A

Objects can be resources or literals (atomic values e.g. strings, numbers)

  • The value of a statement may be a resource, which means nested or linked data
  • This means we can create complex tree and graph structures that slot together.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
Describe RDF resources?
Resources (similar to ER models) are something we want to describe, e.g. people, places and things. - they're any object that possesses a clear identity (within the context of an application) - Every resource has a URI
26
What is a URI and advantages of using this?
A URL (web address) or some other kind of unique identifier: URNs - It's a global, worldwide, unique naming scheme, reduces the problem of distributed data. - It means we can uniquely refer to an entity and know when we use a URI it refers to the same entity - they don't need to correspond to an actual location or file (though it's good practice for URIs to be resolvable to an actual file)
27
Describe RDF properties:
Properties are special types of resources. They describe semantic relations between resources, e.g. written by, age, friend of... - They are identified by a URI
28
What are the 3 views of a statement? and due to this, how can they be viewed as?
A statement can be: - A triple (x, P, y) of logical formula P(x, y), where P is a binary predicate relating objects x and y. - a piece of a graph (subgraph) - an XML code fragment They can be viewed as a set of triples, a graph or an XML document
29
What is a binary predicate?
RDF only offers binary predicates P, e.g. they consist of two parameters (x, y)
30
What are prefixes?
Prefixes are shorthand notations used to simplify URIs. - RDF data is built on triples which often involve long URIs to identify resources and properties. - Prefixes allow you to abbreviate these URIs for readability and manageability.
31
Name 3 very popular prefixes:
- Dbpedia: a community effort to extract structured content from the information created in various Wikimedia projects (e.g Wikipedia). This structured information is an open knowledge graph. - Foaf: A descriptive vocabulary modelling persons, their activities and their relations to other people and objects. FOAF is represented in RDF and OWL - DC: A set of 15 core elements (properties) for describing both digital resources (video, images, web pages, etc), as well as physical resources such as books or CDs, and objects like artworks. DC metadata terms are represented using multiple RDF vocabularies.
32
Describe what a visualisation of an RDF graph looks like:
A graph with labelled nodes and directed arcs - Subjects and objects as nodes - The predicate as arcs of the graph
33
How does RDF ensure that there's no form of ambiguity?
All resources, subjects, predicates and objects are identified through URIs that are unique naming conventions
34
what are higher order statements?
They are formed by reifying statements to express belief, trust and other modalities.
35
What values can nodes and edge labels take? Explain which values a subject, predicate and object can validly take:
They can be a URI, literal or Bnode. In a triple: - A subject can only be a URI or a Bnode - A predicate can only be a URI (never a string or bnode) - an object can only be a URI, literal or a bnode
36
What is Turtle?
- A more human readable syntax for RDF - consisting of RDF triples, in addition to a set of prefaces that define namespaces
37
What is the difference between values in the object being syntactically embedded as opposed to being referenced (linked)?
- Syntactically embedded means you can write out the structure directly in the data e.g. [ "J.R.R. Tolkien"; "1892" ]. - References means you link to other graphs or nodes by using URIs e.g. .
38
What are bnodes? Which components of a triple can we validly use them? Give an example of the syntax for a bnode:
- bnodes or blank nodes denote an RDF node with an anonymous label - meaning the node is not necessarily related with a URI - Bnodes can be used as subjects and objects ex:BWB foaf:based_near _:p1 _:p1 dbpedia:location Amsterdam - This says BWB is based near some resource, which we don’t identify, but this is also linked to the location Amsterdam.
39
Why might we use a Bnode?
- so we can refer to the existence of a resource without identifying it - useful for social media graph networks where an entity might be unknown but they have linked information to it.
40
Why does RDF allows us to make statements about statements and what is the mechanism used to do this?
- Since we can only have binary predicates, we're unable to formulate complex statements, for example if we wanted to relate a level of trust or the source of a triple (we can't as this would make a quadruple) - So we can use Reification to make statements about other RDF statements
41
What is reification and how is it performed?
Reification is the process of turning a statement (subject-predicate-object triple) into a resource, so you can make statements about that statement - e.g. saying Frank is the creator of the triple ex:BWB foaf:based_near _:p1 * rdf:subject, rdf:predicate and rdf:object allow us to automatically access the parts of a statement * This creates a higher order statement, as we're modelling predicates that are no longer binary but of a higher order.
42
Describe what higher order statements are:
- They allow us to express beliefs like trust and attribution about triples in RDF - essentially creating metadata about metadata
43
Give an example of Reification:
Using reificaition, this declares that it was Carol who stated the triple on this date. triple :Alice :knows :Bob . reification :Statement1 a rdf:Statement ; rdf:subject :Alice ; rdf:predicate :knows ; rdf:object :Bob ; :assertedBy :Carol ; :assertedOn "2025-04-30"^^xsd:date .
44
Describe the two ways to represent the ID of a statement wrt RDF Reification:
- rdf:description : is used when you want to describe resources and don't want to talk about the statement further. You do not reify the statement in this case. - rdf:statement is used when you want to make a statement about the statement, using reification.
45
What are named graphs?
- introduced by newer versions of RDF - is the creation of smaller portions of graphs that we can assign an explicit URI to - this reduces the overhead of Reification - this URI can then be referred to in triples
46
Give an example of a regular graph and then in contrast a named graph:
@prefix ex: . @prefix foaf: . Default graph (optional) { ex:alice foaf:knows ex:bob . } Named graph ex:graph1 { ex:alice a foaf:Person ; foaf:name "Alice" . ex:bob a foaf:Person ; foaf:name "Bob" . }
47
What are n-ary predicates?
These are predicates that have more than 2 parameters. These require extra resources or an intermediate resource to split n-ary predicates into n-binary ones since RDF only allows binary predicates.
48
Give an example of a n-ary predicate:
- SuttonHomes is the agent in a home sale between seller John and buyer Mary In turtle: Agent(SuttonHomes, John, Mary) - We introduce an auxiliary resource: swp:home_sale, this becomes the subject of the following triple. @prefix swp :< http://www.swpExample.org/ontology/flats.ttl#> swp: home_sale swp:agent swp: SuttonHomes . swp: home_sale swp:buyer swp:Mary . swp: home sale swp:seller swp:John .
49
List a number of RDF serialisation formats:
* XML * Notation3 or N3 * N-Quads * Turtle * JSON-LD
50
Why do we need RDF serialisation formats?
RDF is not a data format, but a model for describing resources as triples. It's a logical model that needs a physical representation.
51
How can we use RDF to mark up the content of HTML web pages?
By embedding RDF statements or triples within the attributes of HTML tags using RDFa (a syntactic variant of RDF)
52
How do we make statements about a resource?
Using the rdf:description element, we identify a resource in 3 ways: - rdf:about - which references an existing resource (so there's must be a statement either in the same file or another file describing this resource) - rdf:id - this creates a new resource - or by creating an anonymous resource if it's a resource without a name
53
What are property elements in RDF/XML?
* In RDF, a property is the predicate of a triple. * In RDF/XML, a property element is the XML element that corresponds to that predicate. * Property elements connect resources to values or other resources. When RDF is written in RDF/XML syntax, a property element is an XML element that represents the predicate in a triple.
54
What are the two RDF triples produced from this RDF that uses property elements: Example Book John Smith
"Example Book" "John Smith"
55
What is rdf:ID and why do we use it? Give an example of it:
A description using rdf:ID defines a fragment URI/unique identifier. It can reference the defined description. Example Item 19.99 Explanation: rdf:ID="item123" defines the resource as #item123 relative to the base URI of the RDF document. This creates a fragment URI like http://example.org/mydoc#item123 if the RDF document is located at http://example.org/mydoc.
56
Explain why URIs are useful with regard to the semantic web:
- they allow for denoting resources in a general, ambiguous way - this is useful for the semantic web which is a global space of distributed facts, in which resources require a unique naming mechanism
57
What is the format of a URI?
- they should start with a URI schema separated from the following part by a colon ":" - typically URIs are hierarchically organised - they build on the concept of URLs, but not every URI corresponds to a URL/web document
58
What is a self-defined URI?
- when writing your own RDF document, reuse is encouraged, so try to use existing resources or define a new one if you're confidence another URI doesn't exist for that resource
59
Why do we need to define a strategy for avoiding unwanted URI clashes?
- We may have two similar subjects or resources and we want to avoid getting them mixed up - Example: you have a document describing the book Lord of The Ring and 2 URIs: The first URI references the set of triples that describe facts about LoTR in rdf format. The second URI below references the wikipedia page that describes the novel: LoTR. For the first case you can expect an RDF graph, in the second case a human readable document in html. 1) https://www.wikipedia.org/wiki/LoTR#URI 2) 1) https://www.wikipedia.org/wiki/LoTR
60
What syntax do we use to help us interpret values (typically literals and string) given for objects according to their specific data types?
- define a value for the rdf attribute data type and embed this into the element describing our resource - within the tag, place rdf:datatype = "http://www.w3.org/2001/XMLSchema#integer" to say that the value is of type integer - whenever you include a value for a property you should explicitly state what type of data it is, so the rdf processor can assign the correct type even the schema is unknown
61
Which datatype formats does RDF utilise?
- the XML datatype formats since rdf uses the xml format
62
What does Turtle stand for and what is it?
Terse RDF Triple Language - offers a plaintext syntax for rdf based on unicode - an rdf representation of triples where resources are identified with some labels, some identifiers and the namespaces they're defined in
63
What features does Turtle offer?
- a concise syntax for namespace abbreviation - short names for each namespace, allowing us to refer to the local names throughout the document - a mechanism for grouping triples with the same subject / subject and predicate through use of a semicolon ; - a mechanism for collections used for instance to define a list of resources that can be used in the object of some property - gives the expressivity of XML without having to use angle brackets (unless using URIs in full/not abbreviations)
64
What are prefixes?
- a mechanism used to provide namespace abbreviation - vocabularies are typically defined by the same URI so they share a namespace/prefix - syntax: @prefix abbr: - e.g. @prefix swp:
65
What are Qnames in Turtle?
Qnames are qualified names, these allow us to refer to the local name in short. For example we use dc instead of http://purl.org/dc/terms - the Qname is part of the abbreviation at the top of the document
66
Describe more detail about literals used in turtle:
- these are data values, treated as strings but we can add extra information to them - e.g. @lang after the string tells us the language associated with the string - @en tells us the string is in english - '^^type' tells the processor to interpret the value as a specific data type
67
How are Bnodes represented in Turtle?
Blank nodes are represented via [ ] or _:x e.g. swp:jeff swp:owns []. or swp:jeff scp:owns _:x. - either use an empty list or assign a random identifier to it so it can be distinguished from other bnodes
68
What is grouping (bnodes) used for in turtle?
grouping with bnodes is a way to create anonymous RDF resources without giving them explicit URIs or labels: - square brackets are used to define bnodes either as subjects or objects as a subject: - [ predicate object; predicate object ... ] . - [ swp:rents swp:BaronWayApartment; ex:hasName "Meyer" ] . as an object: ex:person1 ex:hasAddress [ ex:street "Main St"; ex:city "Springfield" ] . This triple states that ex:person1 has an address, and that address is a blank node with: ex:street → "Main St", ex:city → "Springfield"1
69
Summarise the syntax of grouping used to create bnodes in turtle:
- Use [ ... ] to create a blank node. - Inside the brackets, define predicates and objects. - Use ; to separate multiple predicates within the same blank node. - You can use , to separate multiple objects for the same predicate (as usual in Turtle).
70
How can bnodes be used to represent collections in turtle? show an example and then the elongated version:
- use list parenthesis: Collections: ( object1 ... objectn ) swp:BaronWayApartment # this tells us resource BaronWayApartment swp:tenant # has predicate tenant (:jeff :mary) . #with object that’s a collection of jeff and mary (the tenants) swp:BaronWayApartment swp:tenant [ rdf:first :jeff; rdf:rest [ rdf:first :mary; rdf:rest rdf:nil ] . #rdf:rest points to the other objects in the list
71
Describe Data types in turtle:
- typing literals makes semantics clearer, ensuring values are treated appropriately - data types are denoted by URIs - frequently XML data types are used - syntax: "datavalue"^^datatype-URI #example for a string datatype
72
What is an interpretation function used for?
for interpreting different data types - it maps from the lexical space to the value space, allowing for expressing the syntax of these values in different ways
73
What is RDFa?
- a serialisation that directly embeds RDF within the attributes of HTML tags, to markup the content of HTML pages - it embeds triples into the HTML attributes - it supports namespaces and URIs, and allows mixing of vocabularies - it exploits structural attributes such as div and span - the RDF data is embedded within the existing HTML DOM, so it is easily modified
74
What are Microformats?
- an approach to add meaning to HTML elements, making data structures in HTML pages explicit - a set of simple, open data formats built upon existing and widely adopted standards - they're a way of combining human and machine readable information
75
what problem do microformats solve?
- representation of geographical information, calendaring information * they in a way provide an “API” for your website * They work in current browsers. * They follow the DRY principle * They’re compatible with the idea of the Web as a single information space
76
What are the main RDFa principles:
- reuse existing HTML/XHTML syntax - use attributes to express metadata - embed RDF Triples - developers don't like to use RDF/XML files so web developers just use the same X(HTML) file that is unchanged by browsers and they ignore attributes they don't know.
77
Describe the process of embedding RDFa in HTML:
1) declare namespaces by exploting the xmlns attribute 2) encode triples in tags such as spans, paragraphs and links - subjects are defined with the about attribute - objects that have a literal as a value are defined in the property attribute - objects that have a resource as a value are defined by the 'rel' attribute
78
How do we use turtle with RDFa:
- use as much turtle as possible - use compact URIs, and make use of the natural structure for shared subjects, shared predicated and create blank nodes
79
Describe the RDFa supported html attributes
- xmlns: a prefix and qualified URL defining a name space for document - about: a resource URI or CURIE (URI w a Qname) use to represent a triple's subject - property: a white-space separated list of CURIE's representing predicates between a subject and a literal (object) - rel: represents predicates between a subject and a resource (object, no literals) - rev: similar to rel but traverses the predicate in the oppositive direction
80
Which syntax should be used to represent rdf statements in html (case-based system)?
- N-triples/n-quads for decent performance or high compatibility - JSON to improve an existing JSON API (don't require RDF parsing) - turtle for human readability & editing RDF - Notation3 if you need RDF rules - RDFa to extend existing HTML pages - RDF/XML if you need to use XML
81
What are RDF container elements:
- allows us to group resources about which we want to make a statement as a whole, e.g. all the apartments in one building - rdf:_1, rdf:_2, ... are used to name the contents of the container elements and make use of bnodes - if we don't require specific bnode identifiers we can use rdf:li, which lists all the elements of the container
82
What are the 4 types of container elements?
- rdf:Bag, an unordered container that allows multiple occurrences - rdf:Seq, an ordered container that allows multiple occurrences - rdf:Alt, a set of alternatives, e.g. different language versions of a document - rdfs:Container, the superclass of all container classes, including the ones above
83
What is an RDF collection?
- unlike RDF containers, RDF collections state that these are all/the only members of a group - so collections describe a group containing only the specified members
84
How are RDF collections specified?
Collections are constructed using the predefined collection vocabulary for lists: * rdf:List is the class to model collection * rdf:first gives us the head of the list * rdf:rest gives us the tail of the list * rdf:nil denotes an empty list
85
Describe RDF:type and what it's used for:
- allows us to state a resource is a of type another resource e.g. the list of tenants in swp is rdf:type rdf:list, so is an element of the class list: swp:ListOfTenant rdf:type rdf:List - using rdf:type means that the subject is an instance of the class of the object - can also use 'a' instead of rdf:type, e.g. swp:BaronWayBuilding a dbpedia-owl:Building
86
What components does RDF vocabulary consist of that give it structure/provide a model for the data represented?
* classes - rdf:Property, rdf:Statement, rdf:XMLLiteral, rdf:Seq, rdf:Bag, rdf:Alt, rdf:List * Properties: rdf:type rdf:subject rdf:predicate rdf:object rdf:first rdf:rest rdf:value * Resources: * rdf:nil
87
How is a schema defined for RDF data:
- use rdf:type to express class membership e.g. swp:apartment rdf:type dbpedia-owl:Building, means that apartment is an instance of/belongs to the class Building
88
88
89
Why is it important to distinguish between classes and their instances:
- we have individual objects that belong to a class, these are referred to as instances of that class. - The relationship between instances and classes in RDF is through rdf:type
89
What is the difference between RDF and RDFS
- RDF is just a data model, it doesn't define semantics for any particular domain - RDFS allows the user to do so by defining: * Classes and Properties * Class Hierarchies and Inheritance * Property Hierarchies
90
What is RDFS
A language used to add domain information and structure an RDF model by defining: - provides a data model for describing schemas - classes, relationships between classes (e.g. subclass of, equivalentTo), and properties of classes - RDFS allows us to refer to individuals, relations between individuals and types of literals and resources
91
What can we describe in RDF as opposed to RDFS:
In RDF: Jeff Meyer - rents -> Baron Way Apartment In RDFS: Jeff Meyer is rdf:type Person, and Baron Way Apartment is rdf:type apartment which is rdfs:subClassOf Residential Unit
92
Describe the RDFS primitives:
*Resource: all resources are implicitly instances of the class rdfs:Resource *Class: describe groups of resources, classes are resources themselves - class hierarchy can be defined through rdfs:subClassOf, every class is a member of rdfs:Class * Property: a subset of rdfs resources that present relationships between resources - properties can have a domain and range - property hierarchies are defined through rdfs:subPropertyOf. * Statements: resources that reify triples
93
Describe the domain and range that a property can have:
- The domain is a class associated with property, rdfs:domain. - The range: type of the property values, rdfs:range. - We read a relationship as going from a domain to a range.
94
What is the list of classes RDFS recognises:
* rdfs:Resource, rdfs:Class, rdfs:Literal, rdfs:Datatype, rdfs:Container, rdfs:Container Membership Property
95
What is the list of properties RDFS recognises:
* rdfs:domain, rdfs:range, rdfs:subPropertyOf, rdfs:subClassOf, rdfs:member, rdfs:seeAlso, rdfs:isDefinedBy, rdfs:comment, rdfs:label - the last 4 are house keeping properties
96
Why do we want to model resources as classes?
- using classes we can impose restrictions about what can be stated in an RDF document using rdfs - e.g. state that only an individual belonging to the class person can be the domain of the rents property
97
Describe class hierarchies:
* attributes/characteristics can be inherited throughout the class hierarchies. * :Apartment is a subclass of :ResidentialUnit if every instance of :Apartment is also an instance of :ResidentialUnit. So :ResidentialUnit is a superclass of :Apartment. * A subclass graph need not be a tree, meaning every node can have multiple parent nodes and therefore multiple superclasses that they inherit from.
98
Due to inheritance, why do we need to define range restrictions?
* This is imposed in RDF Schema by fixing the semantics of “rdfs:subClassOf” as it’s not up to the RDF processing software to interpret “rdfs:subClassOf”, that a class is a subclass of another.
99
How does RDFS extend RDF?
RDFS extends RDF by introducing a set of distinguished resources, giving special meaning to certain triples.
100
What principle allows RDF to use any resource in any triple?
The 'anyone can say anything' principle.
101
What does the triple 'swp:Unit rdfs:subClassOf rdfs:Class' imply?
It means every instance of swp:Unit is also a subclass of rdfs:Class.
102
What are the two layers of a structured RDF document?
The RDF layer and the Schema (RDFS) layer.
103
Which keywords are used in RDFS to describe schema components?
subClassOf, Class, Property, subPropertyOf, Resource.
104
What is the role of rdfs:Resource in the RDFS vocabulary?
It is a superclass for both classes and properties.
105
What does it mean that rdfs:Class is an instance and a subclass of rdfs:Resource?
It means rdfs:Class behaves both as a resource and a class in RDF.
106
What three views can we take when examining an RDF graph?
Vocabulary layer, Domain schema layer, and Data layer.
107
What is the role of the domain schema layer in RDFS?
Defines classes and properties that connect them; all are instances of rdfs:Class or rdf:Property. All the properties in the schema are instances of rdf:property.
108
What role does the data layer play in RDF/RDFS?
It structures data according to the defined schema using meaningful triples.
109
How do we describe data types in RDFS?
By usage, using rdfs:domain and rdfs:range to define how properties relate to classes.
110
What inference does RDFS make from ':p rdfs:domain :D' and ':s :p :o'?
It infers ':s rdf:type :D'.
111
What inference does RDFS make from ':p rdfs:range :R' and ':s :p :o'?
It infers ':o rdf:type :R'.
112
What does domain in RDFS refer to?
The subject of any triple that uses the given property as predicate.
113
What does range in RDFS refer to?
The object of any triple that uses the given property as predicate.
114
Is domain/range enforcement strict in RDFS?
No, RDFS infers type information rather than enforcing constraints. The domain and range are just declarations but not logical constraints that will be enforced.
115
What happens when domain/range rules conflict with actual data?
RDFS silently infers types to reconcile; it doesn't throw errors.
116
What risk exists when combining subClassOf with domain/range?
It can lead to unintended inferences due to aggressive RDFS rules.
117
What does the triple 'swp:rents rdfs:range swp:ResidentialUnit' imply if ?x swp:rents ?y?
It infers ?y is a swp:ResidentialUnit and thus a swp:Unit via subclassing.
118
What are semantics in RDFS used for?
To answer queries (using SPARQL) and define the meanings of schema resources. They aim to make the meaning of statements explicit, define what follows from an RDF graph.
119
What is entailment in RDFS?
Deriving implicit triples from existing ones using RDFS rules.
120
What property of subClassOf allows for transitive inferences?
Transitivity.
121
Example of transitive inference with subClassOf?
If A is subClassOf B and B is subClassOf C, then A is subClassOf C.
122
What is a subgraph in RDF?
A set of triples that is a subset of a larger RDF graph.
123
Can a graph be a subgraph of itself?
Yes
124
What are entailment regimes in RDF?
In order to give an interpretation to the various symbols used in our data models, rdf and rdfs use three entailment regimes. - Simple, RDF, and RDFS entailment regimes that define inference behaviour.
125
What does simple entailment allow?
Only graph transformations, no interpretations.
126
What does RDF entailment add?
Interpretation rules for RDF vocabulary like rdf:type and rdf:Property. extra conditions provided only to symbols that belong to the rdf vocabulary, like rdf:type, rdf:property.
127
What does RDFS entailment include?
Extra conditions/interpretations are posed on the rdfs elements in the form of axiomatic triples (triples that represent ground truth) and semantic conditions (statements we can verify if they’re satisfiable or not).
128
What formalism is used for generalisation in entailment rules?
* :a and :b refer to an arbitrary URI i.e. appears in the predicate of a triple * :u and :v refer to an arbitrary URI or blank node ID i.e. appears in the subject of a triple *:x and :y refer to an arbitrary URI, blank node ID or literal i.e. appears in the object of a triple * _:n refers to the ID of a blank node i.e. appearing as a subject or object * :l refers to a literal * i.e. a string that is sometimes found in the object
129
What is entailment rule se1?
From (:u, :a, :x), infer (:u, :a, _:n) - can derive a bnode in the place of the object
130
What is entailment rule se2?
From (:u, :a, :x), infer (_:n, :a, :x). - can derive a bnode in the place of the subject
131
What does se1 do to the object?
Replaces it with a blank node, weakening the triple.
132
What does se2 do to the subject?
Replaces it with a blank node, weakening the triple.
133
When does graph G1 entail graph G2?
If applying entailment rules to G1 produces a graph G’1 such that G2 is a subset of G’1.
134
What is the purpose of se1 and se2 in RDF entailment?
They allow derivation of new triples by weakening the subject or object of existing triples with blank nodes.
135
Example application of se2 on triple 'ex1:john ex1:hasWife ex1:mary'?
We derive _:n ex1:hasWife ex1:mary.
136
What does the derived triple from se2 imply?
It generalises the subject, suggesting 'someone hasWife mary'.
137
When can se1 and se2 be safely applied?
Only if the blank node being introduced is not already present in the graph.
138
What if a blank node already exists when applying se1/se2?
It can only be reused if it's assigned to the same resource as originally intended.
139
What is a binding in the context of se1/se2?
A binding connects a blank node identifier to the resource it substitutes.
140
Can two URI resources be used if they belong to different namespaces?
Yes, RDF allows that as they are treated as distinct.
141
In the graph G1, what triple represents the publisher relationship?
book:uri ex:publishedBy crc:uri
142
What triple shows the title in graph G1?
book:uri ex:title 'SW Technologies'
143
What triple shows the publisher's name in G1?
crc:uri ex:name 'CRC Press'
144
What is G2 trying to infer from G1?
That the book was published by someone (blank node) who is named 'CRC Press'
145
Can predicates be changed when applying se1 or se2?
No, only the subject or object may change; the predicate stays the same.
146
What happens when we apply se1 to 'book:uri ex:publishedBy crc:uri'?
We derive 'book:uri ex:publishedBy _:blank1'
147
What happens when we apply se2 to 'crc:uri ex:name \CRC Press\"'?"
We derive '_:blank1 ex:name \CRC Press\"'"
148
Why is it valid to bind _:blank1 to crc:uri?
Because _:blank1 was introduced by se1 for crc:uri, so it can be reused for the same resource.
149
How do we derive '_:blank1 ex:name _:blank2'?
By applying se1 to the triple '_:blank1 ex:name \CRC Press\"'"
150
What is the final set of derived triples in G’1?
book:uri ex:publishedBy _:blank1, _:blank1 ex:name _:blank2, _:blank1 ex:name 'CRC Press'
151
Why does G1 entail G2 in this example?
Because G2's triples are all present in the extended graph G’1, making G2 a subgraph of G’1.
152
What does RDF(S) entailment allow?
It allows deriving implicit triples not explicitly in the graph using the semantics of the graph's vocabulary.
153
What is the vocabulary of an RDF(S) graph?
The set of names that occur as subject, predicate, or object in the graph.
154
What is the difference between entailments and interpretations?
Entailments derive new assertions from existing ones; interpretations assign meanings to vocabulary symbols in an abstract model.
155
What are the three RDF(S) entailment regimes?
Simple entailment, RDF entailment, and RDFS entailment.
156
What is an RDF axiomatic triple?
A default triple that constrains the grammar of RDF(S) triples, like rdf:type rdfs:domain rdfs:Resource. example: only resources have types: rdf:type rdfs:domain rdfs:Resource .
157
What is the set-theoretic interpretation of classes?
Classes are sets of individuals that share properties; class membership implies set membership.
158
What are the features of a set?
- only contains the symbols ♠︎, ♣︎, ♥︎, ♦︎ and nothing else - unordered - all elements are unique - sets with different elements are not equal {♠︎♣︎} ≠ {♥︎♦︎} - ∈ indicates set membership: ♠︎ ∈ {♠︎♣︎} - The empty set, ∅ or {}, is a set with no elements. - subsets, where A and B be sets. A is a subset of B, if every element of A is in B
159
How are properties seen in RDF?
As binary relations (sets of pairs) between resources.
160
What is model-theoretic semantics in RDF?
It's based on interpretations as potential 'realities' mapping RDF graphs to set-theoretic models.
161
What does RDF entailment add?
Semantics for rdf:type, built-in classes like rdf:Property, and interpretations of datatypes.
162
What is an inference rule?
A formal rule describing how to derive new triples from existing ones.
163
What is proof theory?
The application of inference rules to derive formulas from a set of assumptions (Γ ⊢ μ). * Every formal logic has a set of inference rules that can be used to “prove” some formula μ from a given set of formulas Γ * A formal proof is the sequential application of the inference rules that starts with Γ and ends with μ.
164
Define soundness in inference systems.
* An inference mechanism is sound if it derives only sentences that are entailed. * If Γ ⊢ μ then Γ ⊧ μ → you only derive sentences entailable from our initial set of sentences Γ
165
Define completeness in inference systems.
* An inference mechanism is complete if derives all the sentences that are entailed. * If Γ ⊧ μ then Γ ⊢ μ → derives all the sentences that are entailed
166
What are the four RDF entailment/inference rules?
rdfax, lg (literal generalisation), rdf1, rdf2 1) (rdfax) Infer the triple :u :a :x. for every RDF axiomatic triple :u :a :x. 2) (lg, literal generalisation) If G contains :u :a :l. then infer the triple :u :a _:n. * A specialised version of SE1 that allows generalisation of a literal by a blank node * Other properties of this literal can be inferred via this blank node: e.g. the literal is an instance of a class and literals can only appear as objects in a triple. 3) (rdf1) If G contains a triple :u :a :y. then we can infer :a rdf:type rdf:Property. → A is an instance of the type property. 4) (rdf2) If G contains a triple :u :a :l. where :l is a well formed XML literal then we can infer _:n rdf:type rdf:XMLLiteral.
167
What does the lg rule (literal generalisation) do?
Generalises a literal object into a blank node, allowing inferences about it.
168
What does the rdf1 rule infer?
If a triple uses predicate :a, infer that :a rdf:type rdf:Property.
169
What is required for a graph G1 to RDF-entail G2?
G2 must be simply entailed by a graph G1' derived from G1 using the 4 RDF rules.
170
What does RDFS entailment add over RDF entailment?
Semantic conditions for RDFS vocabulary, including class and property hierarchies.
171
What is reflexivity in rdfs:subClassOf?
A class is always a subclass of itself.
172
What is transitivity in rdfs:subClassOf?
If A is a subclass of B, and B of C, then A is a subclass of C.
173
What is reflexivity in rdfs:subPropertyOf?
A property is always a subproperty of itself.
174
What is transitivity in rdfs:subPropertyOf?
If A is a subproperty of B, and B of C, then A is a subproperty of C.
175
What is the role of domains in RDFS?
If u a v and a has domain x, then u must be an instance of x.
176
What is the role of ranges in RDFS?
If u a v and a has range x, then v must be an instance of x.
177
Define the semantic notions: subgraph and entailment
Subgraph: allows us to take a set of triples in an rdf document that is a subset of the original document. Entailment: set of delegation rules we can apply, that explain the behaviour of the resources used in the rdf schema.
178
What does "G1 entails G2" mean?
It means that G2 is a subgraph of G1.
179
What is the difference between object properties and data type properties?
- Predicates that connect individuals of a class to another class aka object properties (o-prop) - predicates that connect individuals of a class to a literal aka data type properties (d-prop)
180
What loose interpretation can we provide given the notion of sets?
An rdfs:Class is a set of Resources
181
Describe pairs:
* A pair is an ordered collection of two objects: ⟨𝟣, 𝟤⟩ * equality of pairs is based on components: ⟨𝖺, 𝖻⟩ = ⟨𝗑, 𝗒⟩ if and only if x = a and b = y * the order imposed on the elements matters: ⟨𝖺, 𝖻⟩ ≠ ⟨𝖻, 𝖺⟩ * elements can be repeated: ⟨𝟣, 𝟣⟩, so ⟨𝖺, 𝖻⟩ is a pair, irrespectively of whether a = b or not. This gives us the intuition for properties as relations * A relation R between two sets A and B is a set of pairs: ⟨𝖺, 𝖻⟩ ∈ 𝖠 × B, so we denote 𝖱 ⊆ 𝖠 × 𝖡 * 𝖠 × 𝖡 is the set of all pairs ⟨𝖺, 𝖻⟩ where a ∈ 𝖠 𝖺𝗇𝖽 𝖻 ∈ B, gives the cross product between A and B * we write a R b to denote ⟨𝖺, 𝖻⟩ ∈ 𝖱 * a relation R on some set A is a relation between A and A, 𝖠2 The domain of R is the set of all elements x to which the relationship applies to x R … * dom R = { x ∈ A s.t. x R y for some y ∈ B} The range of R is the set of all y such that … R y * range R = { y ∈ B s.t. x R y for some x ∈ A}
182
What additional semantics wrt instances using the rdf:type rdf:property
- Memberships of the built-in class rdf:Propert: rdf:type rdf:type rdf:Property rdf:subject rdf:type rdf:Property rdf:object rdf:type rdf:Property rdf:first rdf:type rdf:Property rdf:rest rdf:type rdf:Property rdf:value rdf:type rdf:Property rdf:nil rdf:type rdf:Property rdf:_:n rdf:type rdf:Property
183
In the following graph point out an inference we know is true but can't be derived from the rdfs entailment rules: ex:isHappilyMarriedTo rdfs:subPropertyOf _:bnode. _:bnode rdfs:domain ex:Person. ex:john ex:isHappilyMarriedTo ex:mary .
The triple ex:john rdf:type ex:Person . is a semantic consequence of the graph above, but this cannot be derived from the inference rules We should be able to denote that john is an instance of person, and belongs to the class represented by the bnode, however we can’t formally derive that from the rdfs inference rules we’ve been given. This exemplifies why rdfs rules are sound but not complete.
184
What is the purpose of the gl rule in RDF inference?
To bring back a literal that has been replaced by a blank node using the lg rule.
185
When can the gl rule be applied?
Only when the blank node identifies a node introduced by weakening a literal using the lg rule.
186
Why can't literals appear in the subject position of RDF triples?
Because literals are not valid subjects in RDF, which prevents invalid inferences.
187
What is used instead of a literal in the subject position for valid inference?
A surrogate blank node.
188
What is a reasoning engine?
A system that infers new information based on the contents of a knowledge base.
189
What must a reasoner be compliant with?
The semantics of the ontology language it supports.
190
Are RDFS inference rules sound or complete?
They are sound but not complete.
191
What does soundness of RDFS rules mean?
All derived inferences are correct with respect to semantics.
192
What does completeness of RDFS rules mean?
All valid semantic inferences are derivable, which RDFS rules do not fully achieve.
193
What is an example of an inference not captured by RDFS rules?
ex:john rdf:type ex:Person from a subPropertyOf and domain relationship.
194
What does decidable mean in logic?
There exists a finite procedure/algorithm to determine if a statement is true or false.
195
Is RDFS entailment decidable?
Yes, despite dealing with an infinite number of axiomatic triples.
196
What is the complexity of checking RDFS entailment?
NP-complete generally, polynomial if G2 has no blank nodes.
197
Name systems that implement RDFS entailment.
Jena, Sesame, Virtuoso, Oracle.
198
How can rules be applied in RDF stores?
Using backward or forward chaining.
199
What is SPARQL?
An RDF query language based on pattern matching RDF graphs.
200
What are SPARQL queries composed of?
Triple patterns that match subgraphs in an RDF graph.
201
What is the result format of SPARQL queries?
XML format.
202
What is a SPARQL endpoint?
A web service that implements the SPARQL protocol.
203
How does SPARQL syntax relate to RDF?
It is based on the Turtle syntax.
204
What can SPARQL do?
Extract values, explore relationships, perform joins, transform vocabularies.
205
How are resources represented in SPARQL?
By URIs, possibly abbreviated as prefixed names.
206
What types of literals does SPARQL support?
Strings, integers, booleans, etc., with proper data types.
207
What are two versions of SPARQL?
SPARQL 1.0 and SPARQL 1.1.
208
What does SPARQL 1.1 add?
Updates, Graph Store HTTP protocol, Service Description, Entailments, Federated Query.
209
What is the main principle of SPARQL queries?
Pattern matching of RDF subgraphs.
210
What are CURIEs?
Compact URIs using prefixes defined by the PREFIX keyword.
211
What are the SPARQL query result forms?
SELECT, CONSTRUCT, DESCRIBE, ASK.
212
What does SELECT return?
Projection of query results.
213
What does CONSTRUCT return?
An RDF Graph matching the defined pattern.
214
What does ASK return?
A yes/no answer based on pattern match.
215
What is a binding?
The result of a SPAQRL query, a pair (variable, rdf term)
216
What does the SELECT clause do in SPARQL?
It filters variables to return; variables can match any node (resource or literal) in the RDF document.
217
What does the DISTINCT keyword do in a SELECT clause?
It ensures non-duplicate results are returned.
218
How do you use wildcard in a SELECT clause?
Use SELECT * to select all variables.
219
What does the FROM clause specify in a SPARQL query?
It specifies the dataset(s) to be queried; FROM can be omitted for the default dataset.
220
What is the function of the WHERE clause?
It declares a graph pattern to match, consisting of triple patterns where any part can be a variable.
221
What is an OPTIONAL clause used for?
To allow the query to succeed even if some triples are missing, consistent with the open world assumption.
222
List types of graph patterns in SPARQL.
Basic graph pattern, Group graph pattern, Optional graph pattern, Union graph pattern, Graph graph pattern.
223
What are basic graph patterns?
Set of triple patterns (RDF triples with variables), using Turtle syntax.
224
Can blank nodes be used in SPARQL queries?
Yes, as subjects and objects of triple patterns but their values are not returned.
225
How do you retrieve full names of all people in a graph?
SELECT ?fullName WHERE {?x vCard:FN ?fullName}
226
How to query the relationship between John and Mary?
SELECT ?p WHERE { :john ?p :mary }
227
How to find the spouse of 'John Smith'?
SELECT ?y WHERE {?x vCard:FN "John Smith". ?x ont:marriedTo ?y}
228
How to get names and first names using blank nodes?
SELECT ?name ?firstName WHERE {?x vCard:N ?name . ?name vCard:Given ?firstName}
229
What is the purpose of FILTER in SPARQL?
To apply conditions on literal values and reduce the number of results returned.
230
Give an example of a FILTER query for eruptions after 1900.
SELECT ?v WHERE {?v rdf:type umbel-sc:Volcano ; p:lastEruption ?le . FILTER ( ?le > 1900) }
231
What are SPARQL solution modifiers?
ORDER BY, LIMIT, OFFSET: modify order or number of results returned.
232
Example: Query people over 30 in KB.
SELECT ?x WHERE {?x ont:hasAge ?age . FILTER(?age > 30)}
233
How do GROUP graph patterns work?
They group patterns and can combine them with UNION clauses for alternative matches.
234
Example of UNION graph pattern for volcanoes in Italy or Norway.
SELECT ?v WHERE {?v rdf:type umbelsc:Volcano . {?v p:location dbpedia:Italy} UNION {?v p:location dbpedia:Norway} }
235
Why are OPTIONAL graph patterns useful?
They allow querying missing data without failing under the open world assumption.
236
How to return names and spouses (if known) from KB?
SELECT ?y ?name WHERE {?x vCard:FN ?name. OPTIONAL {?x ont:marriedTo ?y}}
237
What does UNION graph pattern allow?
It allows querying for multiple alternative graph patterns.
238
How do you express negation in a FILTER?
Using ! (e.g., !BOUND(?x))
239
What kind of functions can be used in FILTER?
Numeric, value comparisons, and SPARQL tests like BOUND(), isLITERAL().
240
Can SPARQL 1.0 express negation directly?
No, SPARQL 1.0 cannot express negation directly; it lacks a negation operator for patterns.
241
How can we simulate negation in SPARQL 1.0?
Using OPTIONAL patterns and the BOUND operator with FILTER(!BOUND(?var)).
242
Why doesn't filtering with STR(?name) != 'Beerenberg' work as intended?
Because the filter is applied regardless of whether ?name is bound, leading to unexpected results.
243
What does the BOUND operator do in SPARQL?
It checks whether a variable has been bound to a value.
244
When using OPTIONAL and BOUND to find volcanoes not called Beerenberg, why does Mount_Baker appear in the result?
Because it has no rdfs:label, so ?name is not bound.
245
How do you query for volcanoes with no rdfs:label?
Use OPTIONAL { ?v rdfs:label ?name } with FILTER(!BOUND(?name)).
246
What does the GRAPH keyword do in SPARQL?
It allows matching parts of a query against specific named graphs in the dataset.
247
What happens if no named graph is specified in a GRAPH query?
The query operates on the default graph or a merge of all graphs in the dataset.
248
How can you restrict a SPARQL query to specific named datasets?
Use the FROM NAMED clause to specify which named graphs the query should run against.
249
What formats can SPARQL query results be returned in?
XML, JSON, RDF (RDF/XML, N-Triples, Turtle), and HTML.
250
What is the purpose of the CONSTRUCT query in SPARQL?
To build a new RDF graph from matched patterns.
251
What happens to unbound variables in a CONSTRUCT query?
Triples with unbound variables are discarded.
252
What is the syntax of a CONSTRUCT query?
CONSTRUCT { triple pattern } WHERE { graph pattern }
253
What is the purpose of an ASK query in SPARQL?
To check if a pattern has any matches, returning 'yes' or 'no'.
254
Can SPARQL queries be written without variables?
Yes, especially for ASK queries.
255
List the graph pattern types:
BGP (basic graph pattern) OPTIONAL UNION (query union between two or more graphs) GROUP GRAPH (express constraints over the graph pattern)