SlideShare uma empresa Scribd logo
1 de 6
Baixar para ler offline
Semantic	
  Web	
  Assignment	
  2	
  
Studentname:	
  	
   	
                    Barry	
  Kollee	
  
Student	
  number:	
  	
                   10349863	
  
Student	
  username:	
  	
                 UvA	
  student	
  (barry.kollee@student.uva.nl)	
  
Assignment	
  name:	
  	
                  WebKR	
  Assignment	
  2	
  	
  

Developing	
  an	
  OWL	
  ontology	
  with	
  Protege	
  
1.	
  Chose	
  the	
  domain	
  of	
  your	
  ontology	
  

My	
  domain	
  is	
  ‘Apple	
  devices	
  specifications’.	
  
	
  
2.	
  Define	
  two	
  classes	
  using	
  restrictions	
  as	
  shown	
  in	
  lecture	
  3	
  
	
  
        • iPhone	
  capacities	
  (device	
  is	
  available	
  in	
  only	
  16,	
  32	
  and	
  64	
  gb.)	
  
                      o {16gb,	
  32gB,	
  64gB}	
  
        • iPod	
  colors(device	
  has	
  only	
  the	
  colors	
  red,	
  blue,	
  pink,	
  green,	
  gray,	
  black)	
  
                      o {red,	
  blue,	
  pink,	
  green,	
  gray,	
  black}	
  
	
  
3.	
  Imagine	
  at	
  least	
  3	
  instances	
  of	
  these	
  classes.	
  For	
  each	
  instance,	
  write	
  a	
  triple	
  in	
  which	
  you	
  assign	
  a	
  
value	
  to	
  one	
  of	
  the	
  preoperties	
  used	
  in	
  the	
  restrictions	
  above.	
  (i.e	
  subject	
  =	
  the	
  instance,	
  predicate	
  =	
  
the	
  property	
  used	
  in	
  the	
  restriction	
  object	
  =	
  the	
  value	
  that	
  you	
  chose)	
  
	
  
        • The	
  property	
  for	
  the	
  iPod	
  is	
  hasColors.	
  
        • The	
  property	
  for	
  the	
  iPhone	
  is	
  hasCapacity.	
  




	
  
	
  
4.	
  Load	
  your	
  ontology	
  into	
  Protege.	
  
	
  
My	
  code	
  written	
  with	
  turtle	
  syntax:	
  
	
  
@prefix        rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix        rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix        owl: <http://www.w3.org/2002/07/owl#> .
@prefix        xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix        ex:     <http://www.example.org/> .

:iPhone rdf:type owl:Class ;
rdfs:label "iPhone" ;

              rdfs:subClassOf :Specifications ,
                              [ rdf:type owl:Restriction ;
                                owl:onProperty ex:hasCapacity ;
                                owl:allValuesFrom ex:Capacity ;
                              ] ;

                           owl:disjointWith ex:Capacity.


:iPod rdf:type owl:Class ;

              rdfs:label "iPod" ;

                           rdfs:subClassOf :Specifications ,
                                    [ rdf:type owl:Restriction ;
                                       owl:onProperty ex:hasColors ;
                                      owl:allValuesFrom ex:Colors .
                                    ] ;

              owl:disjointWith ex:Colors .

ex:16gB                                               rdf:type                          ex:Capacity .
ex:32gB                                               rdf:type                          ex:Capacity .
ex:64gB                                               rdf:type                          ex:Capacity .
ex:red                                                rdf:type                          ex:Colors .
ex:blue                                               rdf:type                          ex:Colors .
ex:pink                                               rdf:type                          ex:Colors .
ex:green                                              rdf:type                          ex:Colors .
ex:gray                                               rdf:type                          ex:Colors .
ex:black                                              rdf:type                          ex:Colors .
	
  
	
  
	
  
	
  
5.	
  Show	
  that	
  Protege	
  classifes	
  your	
  instances	
  correctly.	
  	
  
	
  




                                                                                                        	
  
 
 
                                     Output	
  of	
  the	
  Class	
  Hierarchy	
  (OntoGraf)	
  with	
  Protégé	
  4.1	
  
	
  
6.	
  Explain	
  which	
  type	
  of	
  restriction	
  you	
  used.	
  owl:someValuesFrom,	
  owl:allValuesFrom,	
  
owl:hasValue,	
  owl:cardinality	
  
	
  
I’ve	
  used	
  owl:	
  allValuesFrom	
  for	
  both	
  of	
  my	
  classes.	
  You	
  would	
  be	
  unable	
  to	
  predict	
  if	
  an	
  iPhone	
  has	
  a	
  
specific	
  capacity	
  or	
  not.	
  For	
  that	
  reason	
  I’ve	
  chosen	
  for	
  owl:allValuesFrom	
  which	
  results	
  in	
  all	
  the	
  
possible	
  results;	
  in	
  this	
  case	
  the	
  iPhone	
  capacities.	
  
	
  
On	
  the	
  other	
  hand	
  we	
  have	
  the	
  iPod	
  hasColors:	
  property.	
  The	
  reason	
  for	
  choosing	
  owl:allValuesFrom	
  
is	
  equal	
  as	
  my	
  explanation	
  for	
  choosing	
  it	
  with	
  the	
  iPhone.	
  You	
  would	
  be	
  unable	
  to	
  predict	
  if	
  iPod’s	
  
have	
  one	
  Color	
  or	
  more.	
  With	
  owl:allValuesFrom	
  we	
  cover	
  the	
  whole	
  list.	
  
	
  
7.	
  Did	
  you	
  use	
  necessary	
  or	
  necessary	
  and	
  sufficient	
  conditions?	
  
	
  
I	
  used	
  sufficient	
  conditions,	
  because	
  you	
  can’t	
  be	
  sure	
  what	
  kind	
  of	
  Colors	
  of	
  Capacities	
  you	
  will	
  find	
  
under	
  Capacity	
  and	
  Colors.	
  
	
  
SPARQL	
  
Perform	
  3	
  queries	
  on	
  http://www.dbpedia.org.	
  You	
  can	
  use	
  one	
  of	
  their	
  web	
  interfaces	
  to	
  perform	
  the	
  
queries	
  either	
  http://dbpedia.org/snorql/	
  or	
  http://dbpedia.org/sparql	
  .	
  Alternatively,	
  you	
  can	
  use	
  
ARQ.	
  Hand	
  in	
  the	
  3	
  queries	
  along	
  with	
  the	
  results	
  for	
  each	
  query.	
  You	
  should	
  show	
  examples	
  of	
  
both	
  schema	
  queries	
  and	
  regular	
  queries.	
  Identify,	
  which	
  queries	
  are	
  schema	
  queries	
  and	
  which	
  ones	
  
are	
  regular.	
  Try	
  at	
  least	
  one	
  query	
  that	
  is	
  not	
  a	
  select	
  query	
  (e.g	
  a	
  construct	
  or	
  ask	
  query).	
  
	
  
First	
  Query:	
  Select	
  Query	
  for	
  the	
  Semantic_Web	
  (abstract)	
  
	
  
SELECT ?abstract
WHERE {
{ <http://dbpedia.org/resource/Semantic_Web>
<http://dbpedia.org/ontology/abstract> ?abstract }
}	
  
Gives	
  me	
  several	
  results	
  (all	
  kinds	
  of	
  languages).	
  The	
  English	
  one	
  gives:	
  
	
  
"The	
  Semantic	
  Web	
  is	
  a	
  collaborative	
  movement	
  led	
  by	
  the	
  World	
  Wide	
  Web	
  Consortium	
  (W3C)	
  that	
  
promotes	
  common	
  formats	
  for	
  data	
  on	
  the	
  World	
  Wide	
  Web.	
  By	
  encouraging	
  the	
  inclusion	
  of	
  
semantic	
  content	
  in	
  web	
  pages,	
  the	
  Semantic	
  Web	
  aims	
  at	
  converting	
  the	
  current	
  web	
  of	
  
unstructured	
  documents	
  into	
  a	
  "web	
  of	
  data".	
  It	
  builds	
  on	
  the	
  W3C's	
  Resource	
  Description	
  
Framework	
  (RDF).	
  According	
  to	
  the	
  W3C,	
  "The	
  Semantic	
  Web	
  provides	
  a	
  common	
  framework	
  that	
  
allows	
  data	
  to	
  be	
  shared	
  and	
  reused	
  across	
  application,	
  enterprise,	
  and	
  community	
  boundaries.	
  "	
  
The	
  term	
  was	
  coined	
  by	
  Tim	
  Berners-­‐Lee,	
  the	
  inventor	
  of	
  the	
  World	
  Wide	
  Web	
  and	
  director	
  of	
  the	
  
World	
  Wide	
  Web	
  Consortium,	
  which	
  oversees	
  the	
  development	
  of	
  proposed	
  Semantic	
  Web	
  standards.	
  
He	
  defines	
  the	
  Semantic	
  Web	
  as	
  "a	
  web	
  of	
  data	
  that	
  can	
  be	
  processed	
  directly	
  and	
  indirectly	
  by	
  
machines.	
  "	
  While	
  its	
  critics	
  have	
  questioned	
  its	
  feasibility,	
  proponents	
  argue	
  that	
  applications	
  in	
  
industry,	
  biology	
  and	
  human	
  sciences	
  research	
  have	
  already	
  proven	
  the	
  validity	
  of	
  the	
  original	
  
concept.	
  Scholars	
  have	
  explored	
  the	
  social	
  potential	
  of	
  the	
  semantic	
  web	
  in	
  the	
  business	
  and	
  health	
  
sectors,	
  and	
  for	
  social	
  networking.	
  The	
  original	
  2001	
  Scientific	
  American	
  article	
  by	
  Berners-­‐Lee	
  
described	
  an	
  expected	
  evolution	
  of	
  the	
  existing	
  Web	
  to	
  a	
  Semantic	
  Web,	
  but	
  this	
  has	
  yet	
  to	
  happen.	
  
In	
  2006,	
  Berners-­‐Lee	
  and	
  colleagues	
  stated	
  that:	
  "This	
  simple	
  idea...	
  remains	
  largely	
  
                             1
unrealized.""@en 	
  
	
  
                                                                                                                       2
Second	
  Query:	
  Select	
  Query	
  for	
  Concepts	
  of	
  DBPedia	
  (with	
  a	
  limit	
  of	
  5	
  results) 	
  
	
  
SELECT	
  DISTINCT	
  ?Concept	
  where	
  {?s	
  a	
  ?Concept}	
  LIMIT	
  5	
  
	
  
This	
  Query	
  gives	
  me	
  this	
  result:	
  
	
  
	
  
	
  
	
  
	
  
	
  
	
  
Third	
  Query:	
  Comparing	
  the	
  height	
  of	
  the	
  Eiffel	
  Tower	
  to	
  the	
  Rocky	
  Mountains	
  
	
  
PREFIX prop: <http://dbpedia.org/property/>

                                                                                                                                              ASK
{
              <http://dbpedia.org/resource/Eiffel_Tower> prop:height ?eiffel .
              <http://dbpedia.org/resource/Rocky_Mountains> prop:height ?rocky .
              FILTER(?eiffel > ?rocky) .
}
	
  
Gives	
  me	
  the	
  result	
  true.	
  




	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  
1	
  http://dbpedia.org/sparql?default-­‐graph-­‐
uri=http%3A%2F%2Fdbpedia.org&query=SELECT+%3Fabstract%0D%0AWHERE+{%0D%0A{+%3Chttp%3A%2F%2Fd
bpedia.org%2Fresource%2FSemantic_Web%3E+%3Chttp%3A%2F%2Fdbpedia.org%2Fontology%2Fabstract%3E+%3F
abstract+}%0D%0A}%0D%0A&format=text%2Fhtml&timeout=0&debug=on;	
  result	
  of	
  Quering	
  
http://dbpedia.org/resource/Semantic_Web	
  	
  
2	
  http://www.cambridgesemantics.com/semantic-­‐university/sparql-­‐by-­‐example	
  	
  

	
  
 
PREFIX prop: <http://dbpedia.org/property/>

                                                                ASK
{
           <http://dbpedia.org/resource/Eiffel_Tower> prop:height ?eiffel .
           <http://dbpedia.org/resource/Rocky_Mountains> prop:height ?rocky .
           FILTER(?eiffel < ?rocky) .
}	
  	
  	
  	
  
	
  
Gives	
  me	
  the	
  result	
  false.	
  
	
  
The	
  reults	
  which	
  I	
  retrieved	
  from	
  the	
  Select	
  query	
  of	
  the	
  concepts	
  gave	
  me	
  a	
  schema	
  because	
  I	
  used	
  a	
  
                                                                                       3
metaclass	
  which	
  identifies	
  my	
  query	
  as	
  a	
  schema	
  query. 	
  
	
  
Joseki	
  
	
  
Set	
  up	
  Joseki	
  (http://www.joseki.org/)	
  You'll	
  _nd	
  instructions	
  on	
  black-­‐	
  
board.	
  Load	
  your	
  ontology	
  into	
  Joseki.	
  Write	
  one	
  sparql	
  sparql	
  query	
  that	
  
you	
  can	
  run	
  over	
  your	
  ontology.	
  Show	
  the	
  results	
  of	
  running	
  those	
  queries	
  
against	
  your	
  ontology.	
  
	
  
Unfortunately	
  I	
  was	
  unable	
  to	
  get	
  Joseki	
  running	
  on	
  my	
  Mac.	
  It	
  could	
  be	
  because	
  of	
  compatibility	
  
issues.	
  (I’ve	
  got	
  mountain	
  Lyon	
  installed).	
  
	
  
However	
  I	
  did	
  some	
  research	
  on	
  a	
  possible	
  query	
  for	
  querying	
  the	
  iPod	
  color.	
  Which	
  I	
  could	
  not	
  
test	
  unfortunately.4	
  
	
  
PREFIX : <http://www.w3.org/2011/12/appledevicespecifications.owl#>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>

SELECT ?color
FROM <http://www.w3.org/2011/12/appledevicespecifications.owl>
WHERE {    ?iPod rdf:type/rdfs:subClassOf* color:Colors . }
	
  




	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  	
  
3	
  http://msdn.microsoft.com/en-­‐us/library/windows/desktop/aa393278%28v=vs.85%29.aspx	
  	
  
4	
  http://www.cambridgesemantics.com/semantic-­‐university/sparql-­‐by-­‐example	
  	
  

Mais conteúdo relacionado

Mais procurados

RDA, FRBR, and FRAD: Connecting the dots
RDA, FRBR, and FRAD: Connecting the dotsRDA, FRBR, and FRAD: Connecting the dots
RDA, FRBR, and FRAD: Connecting the dotsLouise Spiteri
 
The design, architecture, and tradeoffs of FluidDB
The design, architecture, and tradeoffs of FluidDBThe design, architecture, and tradeoffs of FluidDB
The design, architecture, and tradeoffs of FluidDBTerry Jones
 
Qedia - Natural Language Queries on DBPedia
Qedia - Natural Language Queries on DBPediaQedia - Natural Language Queries on DBPedia
Qedia - Natural Language Queries on DBPedialucianb
 
Rdf In A Nutshell V1
Rdf In A Nutshell V1Rdf In A Nutshell V1
Rdf In A Nutshell V1Fabien Gandon
 
RDF Tutorial - SPARQL 20091031
RDF Tutorial - SPARQL 20091031RDF Tutorial - SPARQL 20091031
RDF Tutorial - SPARQL 20091031kwangsub kim
 
A Semantic Multimedia Web (Part 2)
A Semantic Multimedia Web (Part 2)A Semantic Multimedia Web (Part 2)
A Semantic Multimedia Web (Part 2)Raphael Troncy
 
Aidan's PhD Viva
Aidan's PhD VivaAidan's PhD Viva
Aidan's PhD VivaAidan Hogan
 
SPARQL and the Open Linked Data initiative
SPARQL and the Open Linked Data initiativeSPARQL and the Open Linked Data initiative
SPARQL and the Open Linked Data initiativeFulvio Corno
 
Creating web applications with LODSPeaKr
Creating web applications with LODSPeaKrCreating web applications with LODSPeaKr
Creating web applications with LODSPeaKrAlvaro Graves
 
An introduction to Semantic Web and Linked Data
An introduction to Semantic  Web and Linked DataAn introduction to Semantic  Web and Linked Data
An introduction to Semantic Web and Linked DataGabriela Agustini
 
RDF for Librarians
RDF for LibrariansRDF for Librarians
RDF for LibrariansJenn Riley
 
Querying the Semantic Web with SPARQL
Querying the Semantic Web with SPARQLQuerying the Semantic Web with SPARQL
Querying the Semantic Web with SPARQLEmanuele Della Valle
 
2011 4IZ440 Semantic Web – RDF, SPARQL, and software APIs
2011 4IZ440 Semantic Web – RDF, SPARQL, and software APIs2011 4IZ440 Semantic Web – RDF, SPARQL, and software APIs
2011 4IZ440 Semantic Web – RDF, SPARQL, and software APIsJosef Petrák
 

Mais procurados (19)

RDA, FRBR, and FRAD: Connecting the dots
RDA, FRBR, and FRAD: Connecting the dotsRDA, FRBR, and FRAD: Connecting the dots
RDA, FRBR, and FRAD: Connecting the dots
 
The design, architecture, and tradeoffs of FluidDB
The design, architecture, and tradeoffs of FluidDBThe design, architecture, and tradeoffs of FluidDB
The design, architecture, and tradeoffs of FluidDB
 
Qedia - Natural Language Queries on DBPedia
Qedia - Natural Language Queries on DBPediaQedia - Natural Language Queries on DBPedia
Qedia - Natural Language Queries on DBPedia
 
Ontologies in RDF-S/OWL
Ontologies in RDF-S/OWLOntologies in RDF-S/OWL
Ontologies in RDF-S/OWL
 
Rdf In A Nutshell V1
Rdf In A Nutshell V1Rdf In A Nutshell V1
Rdf In A Nutshell V1
 
RDF Tutorial - SPARQL 20091031
RDF Tutorial - SPARQL 20091031RDF Tutorial - SPARQL 20091031
RDF Tutorial - SPARQL 20091031
 
A Semantic Multimedia Web (Part 2)
A Semantic Multimedia Web (Part 2)A Semantic Multimedia Web (Part 2)
A Semantic Multimedia Web (Part 2)
 
Aidan's PhD Viva
Aidan's PhD VivaAidan's PhD Viva
Aidan's PhD Viva
 
Ist16-04 An introduction to RDF
Ist16-04 An introduction to RDF Ist16-04 An introduction to RDF
Ist16-04 An introduction to RDF
 
SWT Lecture Session 2 - RDF
SWT Lecture Session 2 - RDFSWT Lecture Session 2 - RDF
SWT Lecture Session 2 - RDF
 
SPARQL and the Open Linked Data initiative
SPARQL and the Open Linked Data initiativeSPARQL and the Open Linked Data initiative
SPARQL and the Open Linked Data initiative
 
Introduction to SPARQL
Introduction to SPARQLIntroduction to SPARQL
Introduction to SPARQL
 
Creating web applications with LODSPeaKr
Creating web applications with LODSPeaKrCreating web applications with LODSPeaKr
Creating web applications with LODSPeaKr
 
An introduction to Semantic Web and Linked Data
An introduction to Semantic  Web and Linked DataAn introduction to Semantic  Web and Linked Data
An introduction to Semantic Web and Linked Data
 
RDF Data Model
RDF Data ModelRDF Data Model
RDF Data Model
 
RDF for Librarians
RDF for LibrariansRDF for Librarians
RDF for Librarians
 
Querying the Semantic Web with SPARQL
Querying the Semantic Web with SPARQLQuerying the Semantic Web with SPARQL
Querying the Semantic Web with SPARQL
 
Data in RDF
Data in RDFData in RDF
Data in RDF
 
2011 4IZ440 Semantic Web – RDF, SPARQL, and software APIs
2011 4IZ440 Semantic Web – RDF, SPARQL, and software APIs2011 4IZ440 Semantic Web – RDF, SPARQL, and software APIs
2011 4IZ440 Semantic Web – RDF, SPARQL, and software APIs
 

Semelhante a Semantic web assignment 2

Scala Days San Francisco
Scala Days San FranciscoScala Days San Francisco
Scala Days San FranciscoMartin Odersky
 
Linking the world with Python and Semantics
Linking the world with Python and SemanticsLinking the world with Python and Semantics
Linking the world with Python and SemanticsTatiana Al-Chueyr
 
2016-11-12 02 Николай Линкер. Чему Java может поучиться у Haskell и наоборот
2016-11-12 02 Николай Линкер. Чему Java может поучиться у Haskell и наоборот2016-11-12 02 Николай Линкер. Чему Java может поучиться у Haskell и наоборот
2016-11-12 02 Николай Линкер. Чему Java может поучиться у Haskell и наоборотОмские ИТ-субботники
 
Codegeneration Goodies
Codegeneration GoodiesCodegeneration Goodies
Codegeneration Goodiesmeysholdt
 
flatMap Oslo presentation slides
flatMap Oslo presentation slidesflatMap Oslo presentation slides
flatMap Oslo presentation slidesMartin Odersky
 
Martin Odersky - Evolution of Scala
Martin Odersky - Evolution of ScalaMartin Odersky - Evolution of Scala
Martin Odersky - Evolution of ScalaScala Italy
 
Distro Recipes 2013 : Contribution of RDF metadata for traceability among pro...
Distro Recipes 2013 : Contribution of RDF metadata for traceability among pro...Distro Recipes 2013 : Contribution of RDF metadata for traceability among pro...
Distro Recipes 2013 : Contribution of RDF metadata for traceability among pro...Anne Nicolas
 
Presentation distro recipes-2013
Presentation distro recipes-2013Presentation distro recipes-2013
Presentation distro recipes-2013olberger
 
Software Engineering Thailand: Programming with Scala
Software Engineering Thailand: Programming with ScalaSoftware Engineering Thailand: Programming with Scala
Software Engineering Thailand: Programming with ScalaBrian Topping
 
Intro to OWL & Ontology
Intro to OWL & OntologyIntro to OWL & Ontology
Intro to OWL & OntologyNarni Rajesh
 
Understanding the Standards Gap
Understanding the Standards GapUnderstanding the Standards Gap
Understanding the Standards GapDan Brickley
 
Scala - The Simple Parts, SFScala presentation
Scala - The Simple Parts, SFScala presentationScala - The Simple Parts, SFScala presentation
Scala - The Simple Parts, SFScala presentationMartin Odersky
 
Joy Nelson - Workshop on BIBFRAME, RDF and SPAQL
Joy Nelson - Workshop on BIBFRAME, RDF and SPAQLJoy Nelson - Workshop on BIBFRAME, RDF and SPAQL
Joy Nelson - Workshop on BIBFRAME, RDF and SPAQLKohaGruppoItaliano
 
Sugar Presentation - YULHackers March 2009
Sugar Presentation - YULHackers March 2009Sugar Presentation - YULHackers March 2009
Sugar Presentation - YULHackers March 2009spierre
 
Ruby semweb 2011-12-06
Ruby semweb 2011-12-06Ruby semweb 2011-12-06
Ruby semweb 2011-12-06Gregg Kellogg
 
Chapter 4 semantic web
Chapter 4 semantic webChapter 4 semantic web
Chapter 4 semantic webR A Akerkar
 

Semelhante a Semantic web assignment 2 (20)

How DSL works on Ruby
How DSL works on RubyHow DSL works on Ruby
How DSL works on Ruby
 
Scala Days San Francisco
Scala Days San FranciscoScala Days San Francisco
Scala Days San Francisco
 
Linking the world with Python and Semantics
Linking the world with Python and SemanticsLinking the world with Python and Semantics
Linking the world with Python and Semantics
 
2016-11-12 02 Николай Линкер. Чему Java может поучиться у Haskell и наоборот
2016-11-12 02 Николай Линкер. Чему Java может поучиться у Haskell и наоборот2016-11-12 02 Николай Линкер. Чему Java может поучиться у Haskell и наоборот
2016-11-12 02 Николай Линкер. Чему Java может поучиться у Haskell и наоборот
 
Nikunau
NikunauNikunau
Nikunau
 
Codegeneration Goodies
Codegeneration GoodiesCodegeneration Goodies
Codegeneration Goodies
 
flatMap Oslo presentation slides
flatMap Oslo presentation slidesflatMap Oslo presentation slides
flatMap Oslo presentation slides
 
Flatmap
FlatmapFlatmap
Flatmap
 
Martin Odersky - Evolution of Scala
Martin Odersky - Evolution of ScalaMartin Odersky - Evolution of Scala
Martin Odersky - Evolution of Scala
 
Distro Recipes 2013 : Contribution of RDF metadata for traceability among pro...
Distro Recipes 2013 : Contribution of RDF metadata for traceability among pro...Distro Recipes 2013 : Contribution of RDF metadata for traceability among pro...
Distro Recipes 2013 : Contribution of RDF metadata for traceability among pro...
 
Presentation distro recipes-2013
Presentation distro recipes-2013Presentation distro recipes-2013
Presentation distro recipes-2013
 
Software Engineering Thailand: Programming with Scala
Software Engineering Thailand: Programming with ScalaSoftware Engineering Thailand: Programming with Scala
Software Engineering Thailand: Programming with Scala
 
Intro to OWL & Ontology
Intro to OWL & OntologyIntro to OWL & Ontology
Intro to OWL & Ontology
 
Understanding the Standards Gap
Understanding the Standards GapUnderstanding the Standards Gap
Understanding the Standards Gap
 
Scala - The Simple Parts, SFScala presentation
Scala - The Simple Parts, SFScala presentationScala - The Simple Parts, SFScala presentation
Scala - The Simple Parts, SFScala presentation
 
Joy Nelson - Workshop on BIBFRAME, RDF and SPAQL
Joy Nelson - Workshop on BIBFRAME, RDF and SPAQLJoy Nelson - Workshop on BIBFRAME, RDF and SPAQL
Joy Nelson - Workshop on BIBFRAME, RDF and SPAQL
 
Scalax
ScalaxScalax
Scalax
 
Sugar Presentation - YULHackers March 2009
Sugar Presentation - YULHackers March 2009Sugar Presentation - YULHackers March 2009
Sugar Presentation - YULHackers March 2009
 
Ruby semweb 2011-12-06
Ruby semweb 2011-12-06Ruby semweb 2011-12-06
Ruby semweb 2011-12-06
 
Chapter 4 semantic web
Chapter 4 semantic webChapter 4 semantic web
Chapter 4 semantic web
 

Mais de BarryK88

Data mining test notes (back)
Data mining test notes (back)Data mining test notes (back)
Data mining test notes (back)BarryK88
 
Data mining test notes (front)
Data mining test notes (front)Data mining test notes (front)
Data mining test notes (front)BarryK88
 
Data mining Computerassignment 3
Data mining Computerassignment 3Data mining Computerassignment 3
Data mining Computerassignment 3BarryK88
 
Data mining assignment 2
Data mining assignment 2Data mining assignment 2
Data mining assignment 2BarryK88
 
Data mining assignment 4
Data mining assignment 4Data mining assignment 4
Data mining assignment 4BarryK88
 
Data mining assignment 3
Data mining assignment 3Data mining assignment 3
Data mining assignment 3BarryK88
 
Data mining assignment 5
Data mining assignment 5Data mining assignment 5
Data mining assignment 5BarryK88
 
Data mining assignment 6
Data mining assignment 6Data mining assignment 6
Data mining assignment 6BarryK88
 
Data mining assignment 1
Data mining assignment 1Data mining assignment 1
Data mining assignment 1BarryK88
 
Data mining Computerassignment 2
Data mining Computerassignment 2Data mining Computerassignment 2
Data mining Computerassignment 2BarryK88
 
Data mining Computerassignment 1
Data mining Computerassignment 1Data mining Computerassignment 1
Data mining Computerassignment 1BarryK88
 
Semantic web assignment1
Semantic web assignment1Semantic web assignment1
Semantic web assignment1BarryK88
 

Mais de BarryK88 (12)

Data mining test notes (back)
Data mining test notes (back)Data mining test notes (back)
Data mining test notes (back)
 
Data mining test notes (front)
Data mining test notes (front)Data mining test notes (front)
Data mining test notes (front)
 
Data mining Computerassignment 3
Data mining Computerassignment 3Data mining Computerassignment 3
Data mining Computerassignment 3
 
Data mining assignment 2
Data mining assignment 2Data mining assignment 2
Data mining assignment 2
 
Data mining assignment 4
Data mining assignment 4Data mining assignment 4
Data mining assignment 4
 
Data mining assignment 3
Data mining assignment 3Data mining assignment 3
Data mining assignment 3
 
Data mining assignment 5
Data mining assignment 5Data mining assignment 5
Data mining assignment 5
 
Data mining assignment 6
Data mining assignment 6Data mining assignment 6
Data mining assignment 6
 
Data mining assignment 1
Data mining assignment 1Data mining assignment 1
Data mining assignment 1
 
Data mining Computerassignment 2
Data mining Computerassignment 2Data mining Computerassignment 2
Data mining Computerassignment 2
 
Data mining Computerassignment 1
Data mining Computerassignment 1Data mining Computerassignment 1
Data mining Computerassignment 1
 
Semantic web assignment1
Semantic web assignment1Semantic web assignment1
Semantic web assignment1
 

Semantic web assignment 2

  • 1. Semantic  Web  Assignment  2   Studentname:       Barry  Kollee   Student  number:     10349863   Student  username:     UvA  student  (barry.kollee@student.uva.nl)   Assignment  name:     WebKR  Assignment  2     Developing  an  OWL  ontology  with  Protege   1.  Chose  the  domain  of  your  ontology   My  domain  is  ‘Apple  devices  specifications’.     2.  Define  two  classes  using  restrictions  as  shown  in  lecture  3     • iPhone  capacities  (device  is  available  in  only  16,  32  and  64  gb.)   o {16gb,  32gB,  64gB}   • iPod  colors(device  has  only  the  colors  red,  blue,  pink,  green,  gray,  black)   o {red,  blue,  pink,  green,  gray,  black}     3.  Imagine  at  least  3  instances  of  these  classes.  For  each  instance,  write  a  triple  in  which  you  assign  a   value  to  one  of  the  preoperties  used  in  the  restrictions  above.  (i.e  subject  =  the  instance,  predicate  =   the  property  used  in  the  restriction  object  =  the  value  that  you  chose)     • The  property  for  the  iPod  is  hasColors.   • The  property  for  the  iPhone  is  hasCapacity.       4.  Load  your  ontology  into  Protege.     My  code  written  with  turtle  syntax:     @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> . @prefix owl: <http://www.w3.org/2002/07/owl#> . @prefix xsd: <http://www.w3.org/2001/XMLSchema#> . @prefix ex: <http://www.example.org/> . :iPhone rdf:type owl:Class ;
  • 2. rdfs:label "iPhone" ; rdfs:subClassOf :Specifications , [ rdf:type owl:Restriction ; owl:onProperty ex:hasCapacity ; owl:allValuesFrom ex:Capacity ; ] ; owl:disjointWith ex:Capacity. :iPod rdf:type owl:Class ; rdfs:label "iPod" ; rdfs:subClassOf :Specifications , [ rdf:type owl:Restriction ; owl:onProperty ex:hasColors ; owl:allValuesFrom ex:Colors . ] ; owl:disjointWith ex:Colors . ex:16gB rdf:type ex:Capacity . ex:32gB rdf:type ex:Capacity . ex:64gB rdf:type ex:Capacity . ex:red rdf:type ex:Colors . ex:blue rdf:type ex:Colors . ex:pink rdf:type ex:Colors . ex:green rdf:type ex:Colors . ex:gray rdf:type ex:Colors . ex:black rdf:type ex:Colors .         5.  Show  that  Protege  classifes  your  instances  correctly.        
  • 3.  
  • 4.   Output  of  the  Class  Hierarchy  (OntoGraf)  with  Protégé  4.1     6.  Explain  which  type  of  restriction  you  used.  owl:someValuesFrom,  owl:allValuesFrom,   owl:hasValue,  owl:cardinality     I’ve  used  owl:  allValuesFrom  for  both  of  my  classes.  You  would  be  unable  to  predict  if  an  iPhone  has  a   specific  capacity  or  not.  For  that  reason  I’ve  chosen  for  owl:allValuesFrom  which  results  in  all  the   possible  results;  in  this  case  the  iPhone  capacities.     On  the  other  hand  we  have  the  iPod  hasColors:  property.  The  reason  for  choosing  owl:allValuesFrom   is  equal  as  my  explanation  for  choosing  it  with  the  iPhone.  You  would  be  unable  to  predict  if  iPod’s   have  one  Color  or  more.  With  owl:allValuesFrom  we  cover  the  whole  list.     7.  Did  you  use  necessary  or  necessary  and  sufficient  conditions?     I  used  sufficient  conditions,  because  you  can’t  be  sure  what  kind  of  Colors  of  Capacities  you  will  find   under  Capacity  and  Colors.     SPARQL   Perform  3  queries  on  http://www.dbpedia.org.  You  can  use  one  of  their  web  interfaces  to  perform  the   queries  either  http://dbpedia.org/snorql/  or  http://dbpedia.org/sparql  .  Alternatively,  you  can  use   ARQ.  Hand  in  the  3  queries  along  with  the  results  for  each  query.  You  should  show  examples  of   both  schema  queries  and  regular  queries.  Identify,  which  queries  are  schema  queries  and  which  ones   are  regular.  Try  at  least  one  query  that  is  not  a  select  query  (e.g  a  construct  or  ask  query).    
  • 5. First  Query:  Select  Query  for  the  Semantic_Web  (abstract)     SELECT ?abstract WHERE { { <http://dbpedia.org/resource/Semantic_Web> <http://dbpedia.org/ontology/abstract> ?abstract } }   Gives  me  several  results  (all  kinds  of  languages).  The  English  one  gives:     "The  Semantic  Web  is  a  collaborative  movement  led  by  the  World  Wide  Web  Consortium  (W3C)  that   promotes  common  formats  for  data  on  the  World  Wide  Web.  By  encouraging  the  inclusion  of   semantic  content  in  web  pages,  the  Semantic  Web  aims  at  converting  the  current  web  of   unstructured  documents  into  a  "web  of  data".  It  builds  on  the  W3C's  Resource  Description   Framework  (RDF).  According  to  the  W3C,  "The  Semantic  Web  provides  a  common  framework  that   allows  data  to  be  shared  and  reused  across  application,  enterprise,  and  community  boundaries.  "   The  term  was  coined  by  Tim  Berners-­‐Lee,  the  inventor  of  the  World  Wide  Web  and  director  of  the   World  Wide  Web  Consortium,  which  oversees  the  development  of  proposed  Semantic  Web  standards.   He  defines  the  Semantic  Web  as  "a  web  of  data  that  can  be  processed  directly  and  indirectly  by   machines.  "  While  its  critics  have  questioned  its  feasibility,  proponents  argue  that  applications  in   industry,  biology  and  human  sciences  research  have  already  proven  the  validity  of  the  original   concept.  Scholars  have  explored  the  social  potential  of  the  semantic  web  in  the  business  and  health   sectors,  and  for  social  networking.  The  original  2001  Scientific  American  article  by  Berners-­‐Lee   described  an  expected  evolution  of  the  existing  Web  to  a  Semantic  Web,  but  this  has  yet  to  happen.   In  2006,  Berners-­‐Lee  and  colleagues  stated  that:  "This  simple  idea...  remains  largely   1 unrealized.""@en     2 Second  Query:  Select  Query  for  Concepts  of  DBPedia  (with  a  limit  of  5  results)     SELECT  DISTINCT  ?Concept  where  {?s  a  ?Concept}  LIMIT  5     This  Query  gives  me  this  result:                 Third  Query:  Comparing  the  height  of  the  Eiffel  Tower  to  the  Rocky  Mountains     PREFIX prop: <http://dbpedia.org/property/> ASK { <http://dbpedia.org/resource/Eiffel_Tower> prop:height ?eiffel . <http://dbpedia.org/resource/Rocky_Mountains> prop:height ?rocky . FILTER(?eiffel > ?rocky) . }   Gives  me  the  result  true.                                                                                                                   1  http://dbpedia.org/sparql?default-­‐graph-­‐ uri=http%3A%2F%2Fdbpedia.org&query=SELECT+%3Fabstract%0D%0AWHERE+{%0D%0A{+%3Chttp%3A%2F%2Fd bpedia.org%2Fresource%2FSemantic_Web%3E+%3Chttp%3A%2F%2Fdbpedia.org%2Fontology%2Fabstract%3E+%3F abstract+}%0D%0A}%0D%0A&format=text%2Fhtml&timeout=0&debug=on;  result  of  Quering   http://dbpedia.org/resource/Semantic_Web     2  http://www.cambridgesemantics.com/semantic-­‐university/sparql-­‐by-­‐example      
  • 6.   PREFIX prop: <http://dbpedia.org/property/> ASK { <http://dbpedia.org/resource/Eiffel_Tower> prop:height ?eiffel . <http://dbpedia.org/resource/Rocky_Mountains> prop:height ?rocky . FILTER(?eiffel < ?rocky) . }           Gives  me  the  result  false.     The  reults  which  I  retrieved  from  the  Select  query  of  the  concepts  gave  me  a  schema  because  I  used  a   3 metaclass  which  identifies  my  query  as  a  schema  query.     Joseki     Set  up  Joseki  (http://www.joseki.org/)  You'll  _nd  instructions  on  black-­‐   board.  Load  your  ontology  into  Joseki.  Write  one  sparql  sparql  query  that   you  can  run  over  your  ontology.  Show  the  results  of  running  those  queries   against  your  ontology.     Unfortunately  I  was  unable  to  get  Joseki  running  on  my  Mac.  It  could  be  because  of  compatibility   issues.  (I’ve  got  mountain  Lyon  installed).     However  I  did  some  research  on  a  possible  query  for  querying  the  iPod  color.  Which  I  could  not   test  unfortunately.4     PREFIX : <http://www.w3.org/2011/12/appledevicespecifications.owl#> PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#> SELECT ?color FROM <http://www.w3.org/2011/12/appledevicespecifications.owl> WHERE { ?iPod rdf:type/rdfs:subClassOf* color:Colors . }                                                                                                                   3  http://msdn.microsoft.com/en-­‐us/library/windows/desktop/aa393278%28v=vs.85%29.aspx     4  http://www.cambridgesemantics.com/semantic-­‐university/sparql-­‐by-­‐example