Showing posts with label semantic. Show all posts
Showing posts with label semantic. Show all posts

Friday, May 20, 2011

The Berlin SPARQL Benchmark

The Benchmark



Query 1: Find products for a given set of generic features



SELECT DISTINCT ?product ?label

WHERE {

?product rdfs:label ?label .

?product rdf:type %ProductType% .

?product bsbm:productFeature %ProductFeature1% .

?product bsbm:productFeature %ProductFeature2% .

?product bsbm:productPropertyNumeric1 ?value1 .

FILTER (?value1 > %x%)}

ORDER BY ?label

LIMIT 10

Query 2: Retrieve basic information about a specific product for display purposes



SELECT ?label ?comment ?producer ?productFeature ?propertyTextual1

?propertyTextual2 ?propertyTextual3 ?propertyNumeric1

?propertyNumeric2 ?propertyTextual4 ?propertyTextual5

?propertyNumeric4

WHERE {

%ProductXYZ% rdfs:label ?label .

%ProductXYZ% rdfs:comment ?comment .

%ProductXYZ% bsbm:producer ?p .

?p rdfs:label ?producer .

%ProductXYZ% dc:publisher ?p .

%ProductXYZ% bsbm:productFeature ?f .

?f rdfs:label ?productFeature .

%ProductXYZ% bsbm:productPropertyTextual1 ?propertyTextual1 .

%ProductXYZ% bsbm:productPropertyTextual2 ?propertyTextual2 .

%ProductXYZ% bsbm:productPropertyTextual3 ?propertyTextual3 .

%ProductXYZ% bsbm:productPropertyNumeric1 ?propertyNumeric1 .

%ProductXYZ% bsbm:productPropertyNumeric2 ?propertyNumeric2 .

OPTIONAL { %ProductXYZ% bsbm:productPropertyTextual4 ?propertyTextual4 }

OPTIONAL { %ProductXYZ% bsbm:productPropertyTextual5 ?propertyTextual5 }

OPTIONAL { %ProductXYZ% bsbm:productPropertyNumeric4 ?propertyNumeric4 }}

Query 3: Find products having some specific features and not having one feature



SELECT ?product ?label

WHERE {

?product rdfs:label ?label .

?product rdf:type %ProductType% .

?product bsbm:productFeature %ProductFeature1% .

?product bsbm:productPropertyNumeric1 ?p1 .

FILTER ( ?p1 > %x% )

?product bsbm:productPropertyNumeric3 ?p3 .

FILTER (?p3 Query 4: Find products matching two different sets of features


SELECT ?product ?label

WHERE {

{ ?product rdfs:label ?label .

?product rdf:type %ProductType% .

?product bsbm:productFeature %ProductFeature1% .

?product bsbm:productFeature %ProductFeature2% .

?product bsbm:productPropertyNumeric1 ?p1 .

FILTER ( ?p1 > %x% )

} UNION {

?product rdfs:label ?label .

?product rdf:type %ProductType% .

?product bsbm:productFeature %ProductFeature1% .

?product bsbm:productFeature %ProductFeature3% .

?product bsbm:productPropertyNumeric2 ?p2 .

FILTER ( ?p2> %y% ) }}

ORDER BY ?label

LIMIT 10 OFFSET 10

Query 5: Find products that are similar to a given product



SELECT DISTINCT ?product ?productLabel

WHERE {

?product rdfs:label ?productLabel .

FILTER (%ProductXYZ% != ?product)

%ProductXYZ% bsbm:productFeature ?prodFeature .

?product bsbm:productFeature ?prodFeature .

%ProductXYZ% bsbm:productPropertyNumeric1 ?origProperty1 .

?product bsbm:productPropertyNumeric1 ?simProperty1 .

FILTER (?simProperty1

(?origProperty1 - 120))

%ProductXYZ% bsbm:productPropertyNumeric2 ?origProperty2 .

?product bsbm:productPropertyNumeric2 ?simProperty2 .

FILTER (?simProperty2

(?origProperty2 - 170)) }

ORDER BY ?productLabel

LIMIT 5

Query 6: Find products having a label that contains a specific string



SELECT ?product ?label

WHERE {

?product rdfs:label ?label .

?product rdf:type bsbm:Product .

FILTER regex(?label, "%word1%")}

Query 7: Retrieve in-depth information about a product including offers and reviews

SELECT ?productLabel ?offer ?price ?vendor ?vendorTitle ?review

?revTitle ?reviewer ?revName ?rating1 ?rating2

WHERE {

%ProductXYZ% rdfs:label ?productLabel .

OPTIONAL {

?offer bsbm:product %ProductXYZ% .

?offer bsbm:price ?price .

?offer bsbm:vendor ?vendor .

?vendor rdfs:label ?vendorTitle .

?vendor bsbm:country

.

?offer dc:publisher ?vendor .

?offer bsbm:validTo ?date .

FILTER (?date > %currentDate% ) }

OPTIONAL {

?review bsbm:reviewFor %ProductXYZ% .

?review rev:reviewer ?reviewer .

?reviewer foaf:name ?revName .

?review dc:title ?revTitle . OPTIONAL { ?review bsbm:rating1 ?rating1 . }

OPTIONAL { ?review bsbm:rating2 ?rating2 . } } }

Query 8: Give me recent English language reviews for a specific product


SELECT ?title ?text ?reviewDate ?reviewer ?reviewerName ?rating1

?rating2 ?rating3 ?rating4

WHERE {

?review bsbm:reviewFor %ProductXYZ% .

?review dc:title ?title .

?review rev:text ?text .

FILTER langMatches( lang(?text), "EN" )

?review bsbm:reviewDate ?reviewDate .

?review rev:reviewer ?reviewer .

?reviewer foaf:name ?reviewerName .

OPTIONAL { ?review bsbm:rating1 ?rating1 . }

OPTIONAL { ?review bsbm:rating2 ?rating2 . }

OPTIONAL { ?review bsbm:rating3 ?rating3 . }

OPTIONAL { ?review bsbm:rating4 ?rating4 . } }

ORDER BY DESC(?reviewDate) LIMIT 20

Query 9: Get information about a reviewer.


DESCRIBE ?x

WHERE {

%ReviewXYZ% rev:reviewer ?x }

Query 10: Get cheap offers which fulfill the consumer’s delivery requirements.

SELECT DISTINCT ?offer ?price

WHERE {

?offer bsbm:product %ProductXYZ% .

?offer bsbm:vendor ?vendor .

?offer dc:publisher ?vendor .

?vendor bsbm:country %CountryXYZ% .

?offer bsbm:deliveryDays ?deliveryDays .

FILTER (?deliveryDays %currentDate% ) }

ORDER BY xsd:double(str(?price))

LIMIT 10

Query 11: Get all information about an offer.


SELECT ?property ?hasValue ?isValueOf

WHERE {

{ %OfferXYZ% ?property ?hasValue }

UNION

{ ?isValueOf ?property %OfferXYZ% } }

Query 12: Export information about an offer into another schema.

CONSTRUCT {

%OfferXYZ% bsbm-export:product ?productURI .

%OfferXYZ% bsbm-export:productlabel ?productlabel .

%OfferXYZ% bsbm-export:vendor ?vendorname .

%OfferXYZ% bsbm-export:vendorhomepage ?vendorhomepage .

%OfferXYZ% bsbm-export:offerURL ?offerURL .

%OfferXYZ% bsbm-export:price ?price .

%OfferXYZ% bsbm-export:deliveryDays ?deliveryDays .

%OfferXYZ% bsbm-export:validuntil ?validTo }

WHERE {

%OfferXYZ% bsbm:product ?productURI .

?productURI rdfs:label ?productlabel .

%OfferXYZ% bsbm:vendor ?vendorURI .

?vendorURI rdfs:label ?vendorname .

?vendorURI foaf:homepage ?vendorhomepage .

%OfferXYZ% bsbm:offerWebpage ?offerURL .

%OfferXYZ% bsbm:price ?price .

%OfferXYZ% bsbm:deliveryDays ?deliveryDays .

%OfferXYZ% bsbm:validTo ?validTo }

Saturday, April 2, 2011

Applications of Ontologies in Software Engineering

From Hans-Jörg Happel and Stefan Seedorf :
The Article

Abstract. The emerging field of semantic web technologies promises new stimulus for Software Engineering research. However, since the underlying concepts of the semantic web have a long tradition in the knowledge engineering field, it is sometimes hard for software engineers to overlook the variety of ontology-enabled approaches to Software Engineering. In this paper we therefore present some examples of ontology applications throughout the Software Engineering lifecycle. We discuss the advantages of ontologies in each case and provide a framework for classifying the usage of ontologies in Software Engineering.

Documentary about the Semantic Web by Kate Ray

Kate Ray, a Journalism/Psychology major at NYU made a documentary about the Semantic Web. The film gives a nice overview of what the Semantic Web is and what it is trying to achieve.

Friday, February 25, 2011

Open Government Data in Switzerland

Articles & news
Organisations: Firmen: Key players: Presentations: Podcasts:

Open Government Data

What is open government data?

  • By “open” one means open as in the Open (Knowledge) Definition — in essence material (data) is open if it can be freely used, reused and redistributed by anyone.
  • By “government data” one means data and information produced or commissioned by government or government controlled entities.
see http://opengovernmentdata.org/

Monday, February 21, 2011

Harald Sack's blog

Harald Sack's blog: http://moresemantic.blogspot.com/

Videos about linked data

von Harald Sack: http://www.tele-task.de/archive/video/flash/12488/
von Georgi Kobilarov : http://www.yovisto.com/video/17144

Thursday, January 20, 2011

Some definitions about languages

A language consists of a structure definition (called abstract syntax or meta model), a definition of the notation (also called concrete syntax) and semantics. In semantics we distinguish between the static semantics (constraints, typesystem) and the operational semantics (what something means as it is executed).

Thursday, December 16, 2010

Synthax versus Semantic

The synthax defines the correctness of a sequence of characters without meaning. Semantic defines the meaning of this sequence of characters.
Example: 34 + 6 = 100 ist syntactic correct but semantic wrong.

Thursday, December 9, 2010

Is your data 5 star ?

Tim Berners-Lee suggested a 5-star deployment scheme for Linked Open Data and Ed Summers provided a nice rendering of it:




http://www.w3.org/DesignIssues/LinkedData.html

http://lab.linkeddata.deri.ie/2010/star-scheme-by-example/

Friday, November 21, 2008

www.mind-mapping.org

The representation of knowledge in form of graphs let you visualize, classify and connect concepts, ideas, facts or anything that your mind can figure out.
Many ressources related to mind mapping can be found here.
My favorite mind-map tool is the open source XMind based on Eclipse.