<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://info216.wiki.uib.no/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Ged006</id>
	<title>info216 - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="http://info216.wiki.uib.no/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Ged006"/>
	<link rel="alternate" type="text/html" href="http://info216.wiki.uib.no/Special:Contributions/Ged006"/>
	<updated>2026-05-07T04:09:45Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.44.2</generator>
	<entry>
		<id>http://info216.wiki.uib.no/index.php?title=Lab:_More_OWL&amp;diff=1594</id>
		<title>Lab: More OWL</title>
		<link rel="alternate" type="text/html" href="http://info216.wiki.uib.no/index.php?title=Lab:_More_OWL&amp;diff=1594"/>
		<updated>2021-04-20T08:08:20Z</updated>

		<summary type="html">&lt;p&gt;Ged006: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
=Lab 12: More OWL=&lt;br /&gt;
&lt;br /&gt;
==Topics==&lt;br /&gt;
OWL ontology programming with RDFlib.&lt;br /&gt;
&lt;br /&gt;
==Tutorial==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Classes and methods==&lt;br /&gt;
In an earlier lab, you have already used these OWL concepts:&lt;br /&gt;
* (sameAs, equivalentClass, equivalentProperty, differentFrom, disjointWith, inverseOf)&lt;br /&gt;
* (ReflexiveProperty, IrreflexiveProperty, SymmetricProperty, AsymmetricProperty, TransitiveProperty, FunctionalProperty, InverseFunctionalProperty),&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In this lab you will mostly use the following OWL terms:&lt;br /&gt;
&lt;br /&gt;
* (oneOf, unionOf, intersectionOf. complementOf)&lt;br /&gt;
* (Restriction, onProperty)&lt;br /&gt;
* (someValuesFrom, allValuesFrom, hasValue)&lt;br /&gt;
* (cardinality, minCardinality, maxCardinality)&lt;br /&gt;
* (qualifiedCardinality, minQualifiedCardinality, maxQualifiedCardinality, onClass)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
=OWL Restrictions=&lt;br /&gt;
Most of the tasks today involve restrictions. &lt;br /&gt;
&lt;br /&gt;
I Recommend refreshing your memories on restrictions and complex classes from the [https://wiki.uib.no/info216/images/6/69/S12-OWL-2.pdf lecture notes]&lt;br /&gt;
When solving the tasks look at the notes, find the relevant OWL term/s, and try to use the same principles in python code.&lt;br /&gt;
&lt;br /&gt;
Down below is an example solution of the first task: &amp;quot;anyone who is a graduate has at least one degree&amp;quot;.&lt;br /&gt;
It looks complicated, but once you understand it, the other tasks follow a similar pattern. &lt;br /&gt;
In short: I create a blank node that is an OWL.restriction on the ex.degree property.&lt;br /&gt;
The restriction in question is a minCardinality restriction with the value 1. (e.g &amp;quot;at least one&amp;quot;) &lt;br /&gt;
Then I create another blank node that is for a List of all the criteria that makes a person a Graduate.&lt;br /&gt;
In this case I say that a Graduate is the intersection of a Person and the restriction we created earlier.&lt;br /&gt;
Collection is essentially used to create lists and everything between [] is what is in the list (the intersections).  &lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
# anyone who is a graduate has at least one degree&lt;br /&gt;
 &lt;br /&gt;
br = BNode()&lt;br /&gt;
g.add((br, RDF.type, OWL.Restriction))&lt;br /&gt;
g.add((br, OWL.onProperty, ex.degree))&lt;br /&gt;
g.add((br, OWL.minCardinality, Literal(1)))&lt;br /&gt;
bi = BNode()&lt;br /&gt;
Collection(g, bi, [ex.Person, br])&lt;br /&gt;
g.add((ex.Graduate, OWL.intersectionOf, bi))&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Tasks==&lt;br /&gt;
&lt;br /&gt;
Create or Extend a previous graph into an ontology that expresses the following using concepts from OWL (and some from RDF/RDFS):&lt;br /&gt;
* anyone who is a graduate has at least one degree&lt;br /&gt;
* anyone who is a university graduate has at least one degree from a university&lt;br /&gt;
* a grade is either an A, B, C, D, E or F&lt;br /&gt;
* a straight A student is a student that has only A grades&lt;br /&gt;
* a graduate has no F grades&lt;br /&gt;
* a student has a unique student number&lt;br /&gt;
* each student has exactly one average grade&lt;br /&gt;
* a course is either a bachelor, a master or a Ph.D course&lt;br /&gt;
* a bachelor student takes only bachelor courses&lt;br /&gt;
* a masters student takes only master courses and at most one bachelor course&lt;br /&gt;
* a Ph.D student takes only Ph.D and at most two masters courses&lt;br /&gt;
* a Ph.D. student cannot take a bachelor course&lt;br /&gt;
&lt;br /&gt;
Write each of the above statements as python code using RDFlib and OWL.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==Code to get started==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
import owlrl&lt;br /&gt;
from rdflib import Graph, Literal, Namespace, BNode&lt;br /&gt;
from rdflib.namespace import RDF, OWL, RDFS&lt;br /&gt;
from rdflib.collection import Collection&lt;br /&gt;
&lt;br /&gt;
g = Graph()&lt;br /&gt;
ex = Namespace(&amp;quot;http://example.org/&amp;quot;)&lt;br /&gt;
g.bind(&amp;quot;ex&amp;quot;, ex)&lt;br /&gt;
g.bind(&amp;quot;owl&amp;quot;, OWL)&lt;br /&gt;
&lt;br /&gt;
# anyone who is a graduate has at least one degree&lt;br /&gt;
br = BNode()&lt;br /&gt;
g.add((br, RDF.type, OWL.Restriction))&lt;br /&gt;
g.add((br, OWL.onProperty, ex.degree))&lt;br /&gt;
g.add((br, OWL.minCardinality, Literal(1)))&lt;br /&gt;
bi = BNode()&lt;br /&gt;
Collection(g, bi, [ex.Person, br])&lt;br /&gt;
g.add((ex.Graduate, OWL.intersectionOf, bi))&lt;br /&gt;
&lt;br /&gt;
# Continue here with the other statements:&lt;br /&gt;
&lt;br /&gt;
print(g.serialize(format=&amp;quot;turtle&amp;quot;).decode())&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==If You Have More Time==&lt;br /&gt;
Populate the ontology with data. E.g like: &lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
g.add((ex.Cade, RDF.type, ex.Graduate))&lt;br /&gt;
g.add((ex.Cade, ex.grade, ex.A))&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Use owlrl like we did in lab 8 to infer additional triples.&lt;br /&gt;
IMPORANT: It seems owlrl is unable to reason with OWL Restrictions and perhaps other concepts as well.&lt;br /&gt;
There is a python library for better OWL reasoning called Owlready if you want to reason with restrictions.  &lt;br /&gt;
Below I print the ontology before and after the reasoning.&lt;br /&gt;
&lt;br /&gt;
What has changed about e.g Cade after using owlrl?&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
# # Write owl file before any reasoned triples&lt;br /&gt;
g.serialize(destination=&amp;quot;owl1.ttl&amp;quot;, format=&amp;quot;turtle&amp;quot;)&lt;br /&gt;
&lt;br /&gt;
# Infer additional triples&lt;br /&gt;
owl_reasoner = owlrl.CombinedClosure.RDFS_OWLRL_Semantics(g, False, False, False)&lt;br /&gt;
owl_reasoner.closure()&lt;br /&gt;
owl_reasoner.flush_stored_triples()&lt;br /&gt;
&lt;br /&gt;
# Write owl file that includes reasoned triples&lt;br /&gt;
g.serialize(destination=&amp;quot;owl2.ttl&amp;quot;, format=&amp;quot;turtle&amp;quot;)&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- ==Scenarios from previous labs== --&amp;gt;&lt;/div&gt;</summary>
		<author><name>Ged006</name></author>
	</entry>
	<entry>
		<id>http://info216.wiki.uib.no/index.php?title=Lab:_RDFS&amp;diff=1514</id>
		<title>Lab: RDFS</title>
		<link rel="alternate" type="text/html" href="http://info216.wiki.uib.no/index.php?title=Lab:_RDFS&amp;diff=1514"/>
		<updated>2021-02-24T11:12:38Z</updated>

		<summary type="html">&lt;p&gt;Ged006: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
=Lab 5: RDFS Programming with rdflib and owlrl=&lt;br /&gt;
&lt;br /&gt;
==Topics==&lt;br /&gt;
Basic RDFS graph programming in RDFlib.&lt;br /&gt;
Entailments and axioms with owlrl.&lt;br /&gt;
&lt;br /&gt;
==Classes/Methods/Vocabularies==&lt;br /&gt;
owlrl.RDFSClosure (RDFS_Semantics, closure, flush_stored_triples)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Vocabularies: &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
RDF.type&lt;br /&gt;
&lt;br /&gt;
RDFS.subClassOf, RDFS.subPropertyOf, RDFS.domain, RDFS.range, RDFS.label, RDFS.comment, &lt;br /&gt;
&lt;br /&gt;
==Tasks==&lt;br /&gt;
First, pip install owlrl.&lt;br /&gt;
The RDFS Vocabulary can be imported from rdflib.namespace, just like FOAF or RDF.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Consider the following Scenario:&#039;&#039;&#039;&lt;br /&gt;
&amp;quot;University of California and University of Valencia are both Universities.&lt;br /&gt;
All universities are higher education institutions (HEIs). Only persons can have an expertise, and what they have expertise in is always a subject. Having a degree from a HEI means that you have also graduated from that HEI. Only persons can graduate from a HEI. If you are a student, you are in fact a person as well. That a person is married to someone, means that they know them.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Create RDFS triples corresponding to the text above with RDFlib&#039;&#039;&#039; - if you can, try to build on&lt;br /&gt;
your example from lab 2! &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Using these three lines we can add automatically the inferred triples (like ex:University rdf:type ex:Higher_Education_Institute) :&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
rdfs = owlrl.RDFSClosure.RDFS_Semantics(g, False, False, False)&lt;br /&gt;
rdfs.closure()&lt;br /&gt;
rdfs.flush_stored_triples()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check that simple inference works -  make sure that your graph contains triples like these, even if&lt;br /&gt;
you have not asserted them explicitly:&lt;br /&gt;
* that University of California and Valencia are HEIs&lt;br /&gt;
* that Cade, Emma, and Mary are all persons&lt;br /&gt;
* that Cade and Emma have both graduated from some HEI&lt;br /&gt;
* that Cade knows Mary&lt;br /&gt;
&lt;br /&gt;
One way to check if the triples are there:&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
universities = g.query(&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
PREFIX ex: &amp;lt;http://example.org/&amp;gt;&lt;br /&gt;
ASK {&lt;br /&gt;
    ex:University_of_California rdf:type ex:Higher_Education_Institution.&lt;br /&gt;
} &lt;br /&gt;
&amp;quot;&amp;quot;&amp;quot;)&lt;br /&gt;
print(bool(universities))&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rewrite some of your existing code to use rdfs:label in a triple and add an rdfs:comment to the same resource.&lt;br /&gt;
&lt;br /&gt;
==If you have more time...==&lt;br /&gt;
Create a new RDFS graph that wraps an empty graph. This graph contains only RDFS axioms. Write it out in Turtle and check that you understand  the meaning and purpose of each axiom.&lt;br /&gt;
&lt;br /&gt;
Create an RDF (not RDFS) graph that contains all the triples in your first graph (the one with all the people and universities). Subtract all the triples in the axiom graph from the people/university graph. Write it out to see that you are left with only the asserted and entailed triples and that none of the axioms remain.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Download the SKOS vocabulary from https://www.w3.org/2009/08/skos-reference/skos.rdf and save it to a file called, e.g., SKOS.rdf .&lt;br /&gt;
Use the schemagen tool (it is inside your Jena folders, for example under apache-jena-3.1.1/bin) to generate a Java class for the SKOS vocabulary. &lt;br /&gt;
You need to do this from a console window, using a command like &amp;quot;&amp;lt;path&amp;gt;/schemagen -i &amp;lt;infile.rdf&amp;gt; -o &amp;lt;outfile.java&amp;gt;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Copy the SKOS.java file into your project in the same package as your other Java files,  and try to use SKOS properties &lt;br /&gt;
where they fit, for example to organise the keywords for interests and expertise.&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Useful Readings==&lt;br /&gt;
*[https://wiki.uib.no/info216/index.php/File:S05-RDFS-11.pdf Lecture Notes]&lt;br /&gt;
*[https://wiki.uib.no/info216/index.php/Python_Examples Example page]&lt;/div&gt;</summary>
		<author><name>Ged006</name></author>
	</entry>
	<entry>
		<id>http://info216.wiki.uib.no/index.php?title=Lab:_RDFS&amp;diff=1513</id>
		<title>Lab: RDFS</title>
		<link rel="alternate" type="text/html" href="http://info216.wiki.uib.no/index.php?title=Lab:_RDFS&amp;diff=1513"/>
		<updated>2021-02-24T08:47:49Z</updated>

		<summary type="html">&lt;p&gt;Ged006: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
=Lab 7: RDFS Programming with rdflib and owlrl=&lt;br /&gt;
&lt;br /&gt;
==Topics==&lt;br /&gt;
Basic RDFS graph programming in RDFlib.&lt;br /&gt;
Entailments and axioms with owlrl.&lt;br /&gt;
&lt;br /&gt;
==Classes/Methods/Vocabularies==&lt;br /&gt;
owlrl.RDFSClosure (RDFS_Semantics, closure, flush_stored_triples)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Vocabularies: &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
RDF.type&lt;br /&gt;
&lt;br /&gt;
RDFS.subClassOf, RDFS.subPropertyOf, RDFS.domain, RDFS.range, RDFS.label, RDFS.comment, &lt;br /&gt;
&lt;br /&gt;
==Tasks==&lt;br /&gt;
First, pip install owlrl.&lt;br /&gt;
The RDFS Vocabulary can be imported from rdflib.namespace, just like FOAF or RDF.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Consider the following Scenario:&#039;&#039;&#039;&lt;br /&gt;
&amp;quot;University of California and University of Valencia are both Universities.&lt;br /&gt;
All universities are higher education institutions (HEIs). Only persons can have an expertise, and what they have expertise in is always a subject. Having a degree from a HEI means that you have also graduated from that HEI. Only persons can graduate from a HEI. If you are a student, you are in fact a person as well. That a person is married to someone, means that they know them.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Create RDFS triples corresponding to the text above with RDFlib&#039;&#039;&#039; - if you can, try to build on&lt;br /&gt;
your example from lab 2! &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Using these three lines we can add automatically the inferred triples (like ex:University rdf:type ex:Higher_Education_Institute) :&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
rdfs = owlrl.RDFSClosure.RDFS_Semantics(g, False, False, False)&lt;br /&gt;
rdfs.closure()&lt;br /&gt;
rdfs.flush_stored_triples()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check that simple inference works -  make sure that your graph contains triples like these, even if&lt;br /&gt;
you have not asserted them explicitly:&lt;br /&gt;
* that University of California and Valencia are HEIs&lt;br /&gt;
* that Cade, Emma, and Mary are all persons&lt;br /&gt;
* that Cade and Emma have both graduated from some HEI&lt;br /&gt;
* that Cade knows Mary&lt;br /&gt;
&lt;br /&gt;
One way to check if the triples are there:&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
universities = g.query(&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
PREFIX ex: &amp;lt;http://example.org/&amp;gt;&lt;br /&gt;
ASK {&lt;br /&gt;
    ex:University_of_California rdf:type ex:Higher_Education_Institution.&lt;br /&gt;
} &lt;br /&gt;
&amp;quot;&amp;quot;&amp;quot;)&lt;br /&gt;
print(bool(universities))&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rewrite some of your existing code to use rdfs:label in a triple and add an rdfs:comment to the same resource.&lt;br /&gt;
&lt;br /&gt;
==If you have more time...==&lt;br /&gt;
Create a new RDFS graph that wraps an empty graph. This graph contains only RDFS axioms. Write it out in Turtle and check that you understand  the meaning and purpose of each axiom.&lt;br /&gt;
&lt;br /&gt;
Create an RDF (not RDFS) graph that contains all the triples in your first graph (the one with all the people and universities). Subtract all the triples in the axiom graph from the people/university graph. Write it out to see that you are left with only the asserted and entailed triples and that none of the axioms remain.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Download the SKOS vocabulary from https://www.w3.org/2009/08/skos-reference/skos.rdf and save it to a file called, e.g., SKOS.rdf .&lt;br /&gt;
Use the schemagen tool (it is inside your Jena folders, for example under apache-jena-3.1.1/bin) to generate a Java class for the SKOS vocabulary. &lt;br /&gt;
You need to do this from a console window, using a command like &amp;quot;&amp;lt;path&amp;gt;/schemagen -i &amp;lt;infile.rdf&amp;gt; -o &amp;lt;outfile.java&amp;gt;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Copy the SKOS.java file into your project in the same package as your other Java files,  and try to use SKOS properties &lt;br /&gt;
where they fit, for example to organise the keywords for interests and expertise.&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Useful Readings==&lt;br /&gt;
*[https://wiki.uib.no/info216/index.php/File:S05-RDFS-11.pdf Lecture Notes]&lt;br /&gt;
*[https://wiki.uib.no/info216/index.php/Python_Examples Example page]&lt;/div&gt;</summary>
		<author><name>Ged006</name></author>
	</entry>
	<entry>
		<id>http://info216.wiki.uib.no/index.php?title=Lab:_RDFS&amp;diff=1512</id>
		<title>Lab: RDFS</title>
		<link rel="alternate" type="text/html" href="http://info216.wiki.uib.no/index.php?title=Lab:_RDFS&amp;diff=1512"/>
		<updated>2021-02-24T08:28:11Z</updated>

		<summary type="html">&lt;p&gt;Ged006: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&lt;br /&gt;
=Lab 7: RDFS Programming with rdflib and owlrl=&lt;br /&gt;
&lt;br /&gt;
==Topics==&lt;br /&gt;
Basic RDFS graph programming in RDFlib.&lt;br /&gt;
Entailments and axioms with owlrl.&lt;br /&gt;
&lt;br /&gt;
==Classes/Methods/Vocabularies==&lt;br /&gt;
owlrl.RDFSClosure (RDFS_Semantics, closure, flush_stored_triples)&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Vocabularies: &#039;&#039;&#039;&lt;br /&gt;
&lt;br /&gt;
RDF.type&lt;br /&gt;
&lt;br /&gt;
RDFS.subClassOf, RDFS.subPropertyOf, RDFS.domain, RDFS.range, RDFS.label, RDFS.comment, &lt;br /&gt;
&lt;br /&gt;
==Tasks==&lt;br /&gt;
First, pip install owlrl.&lt;br /&gt;
The RDFS Vocabulary can be imported from rdflib.namespace, just like FOAF or RDF.&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Consider the following Scenario:&#039;&#039;&#039;&lt;br /&gt;
&amp;quot;University of California and University of Valencia are both Universities.&lt;br /&gt;
All universities are higher education institutions (HEIs). Only persons can have an expertise, and what they have expertise in is always a subject. Having a degree from a HEI means that you have also graduated from that HEI. Only persons can graduate from a HEI. That a person is married to someone, means that they know them.&amp;quot;&lt;br /&gt;
&lt;br /&gt;
&#039;&#039;&#039;Create RDFS triples corresponding to the text above with RDFlib&#039;&#039;&#039; - if you can, try to build on&lt;br /&gt;
your example from lab 2! &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Using these three lines we can add automatically the inferred triples (like ex:University rdf:type ex:Higher_Education_Institute) :&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
rdfs = owlrl.RDFSClosure.RDFS_Semantics(g, False, False, False)&lt;br /&gt;
rdfs.closure()&lt;br /&gt;
rdfs.flush_stored_triples()&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Check that simple inference works -  make sure that your graph contains triples like these, even if&lt;br /&gt;
you have not asserted them explicitly:&lt;br /&gt;
* that University of California and Valencia are HEIs&lt;br /&gt;
* that Cade and Emma are both persons&lt;br /&gt;
* that Cade and Emma have both graduated from some HEI&lt;br /&gt;
* that Cade knows Mary&lt;br /&gt;
&lt;br /&gt;
One way to check if the triples are there:&lt;br /&gt;
&amp;lt;syntaxhighlight&amp;gt;&lt;br /&gt;
universities = g.query(&amp;quot;&amp;quot;&amp;quot;&lt;br /&gt;
PREFIX ex: &amp;lt;http://example.org/&amp;gt;&lt;br /&gt;
ASK {&lt;br /&gt;
    ex:University_of_California rdf:type ex:Higher_Education_Institution.&lt;br /&gt;
} &lt;br /&gt;
&amp;quot;&amp;quot;&amp;quot;)&lt;br /&gt;
print(bool(universities))&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Rewrite some of your existing code to use rdfs:label in a triple and add an rdfs:comment to the same resource.&lt;br /&gt;
&lt;br /&gt;
==If you have more time...==&lt;br /&gt;
Create a new RDFS graph that wraps an empty graph. This graph contains only RDFS axioms. Write it out in Turtle and check that you understand  the meaning and purpose of each axiom.&lt;br /&gt;
&lt;br /&gt;
Create an RDF (not RDFS) graph that contains all the triples in your first graph (the one with all the people and universities). Subtract all the triples in the axiom graph from the people/university graph. Write it out to see that you are left with only the asserted and entailed triples and that none of the axioms remain.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;!-- Download the SKOS vocabulary from https://www.w3.org/2009/08/skos-reference/skos.rdf and save it to a file called, e.g., SKOS.rdf .&lt;br /&gt;
Use the schemagen tool (it is inside your Jena folders, for example under apache-jena-3.1.1/bin) to generate a Java class for the SKOS vocabulary. &lt;br /&gt;
You need to do this from a console window, using a command like &amp;quot;&amp;lt;path&amp;gt;/schemagen -i &amp;lt;infile.rdf&amp;gt; -o &amp;lt;outfile.java&amp;gt;&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
Copy the SKOS.java file into your project in the same package as your other Java files,  and try to use SKOS properties &lt;br /&gt;
where they fit, for example to organise the keywords for interests and expertise.&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Useful Readings==&lt;br /&gt;
*[https://wiki.uib.no/info216/index.php/File:S05-RDFS-11.pdf Lecture Notes]&lt;br /&gt;
*[https://wiki.uib.no/info216/index.php/Python_Examples Example page]&lt;/div&gt;</summary>
		<author><name>Ged006</name></author>
	</entry>
</feed>