Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Assignment3 #238

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added Assignment2/esteve2604-EstebanAspe.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
13 changes: 13 additions & 0 deletions Assignment2/esteve2604-EstebanAspe.ttl
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
@prefix : <http://example.org/#> .
@prefix prop: <http://example.org/properties/#> .


:Class01 prop:includes :Sensor029;
prop:includes :Computer101;
.
:Sensor029 prop:hasMeasurement :Measurement8401 .
:Measurement8401 prop:hasTemperature 29 ;
prop:atTime "2010-06-12T12:00:12" ;
.
:Computer101 prop:hasOwner :User10A .
:User10A prop:hasName "Pedro" .
31 changes: 31 additions & 0 deletions Assignment2/esteve2604-fromJSONtoJSON-LD.jsonld
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"@context": {
"prop": "http://example.org/properties/#",
"subjects": "http://example.org/subjects/#",
"person": "http://example.org/person/#"
},
"@graph": [
{
"@id": "person:Esteban_Aspe_Ruiz",
"prop:fullName": "Esteban Aspe Ruiz",
"prop:hometown": "Móstoles",
"prop:age": 22,
"prop:almaMater": "Universidad Politécnica de Madrid",
"prop:parentsName": ["Fernando Aspe Fernandez", "Gema Ruiz Pino"],
"subjects": [
{
"@id": "subjects:Open_Data_and_Knowledge graphs",
"prop:name": "Open Data and Knowledge graphs",
"prop:teachers": ["Oscar Corcho", "Daniel Garijo"],
"prop:description": "Subject held in first semester of the master in data science"
},
{
"@id": "subjects:Machine_Learning",
"prop:name": "Machine Learning",
"prop:teachers": ["Concha Bielza"],
"prop:description": "Learning different AI algorithms"
}
]
}
]
}
43 changes: 43 additions & 0 deletions Assignment2/esteve2604-fromRDFtoJSON-LD.jsonld
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"@context": {
"prop": "http://example.org/properties/#",
"xsd": "http://www.w3.org/2001/XMLSchema#"
},
"@graph": [
{
"@id": "http://example.org/#Class01",
"prop:includes": [
{
"@id": "http://example.org/#Sensor029"
},
{
"@id": "http://example.org/#Computer101"
}
]
},
{
"@id": "http://example.org/#Sensor029",
"prop:hasMeasurement": {
"@id": "http://example.org/#Measurement8401"
}
},
{
"@id": "http://example.org/#Computer101",
"prop:hasOwner": {
"@id": "http://example.org/#User10A"
}
},
{
"@id": "http://example.org/#Measurement8401",
"prop:hasTemperature": {
"@type": "xsd:integer",
"@value": "29"
},
"prop:atTime": "2010-06-12T12:00:12"
},
{
"@id": "http://example.org/#User10A",
"prop:hasName": "Pedro"
}
]
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
In all queries LIMIT as been introduced to reduce the answers of the query. If you want all results, please delete the LIMIT.

1. Get all the properties that can be applied to instances of the Politician class (<http://dbpedia.org/ontology/Politician>)

select ?property
where {
?x a <http://dbpedia.org/ontology/Politician> .
?x ?property []
} LIMIT 1000

2. Get all the properties, except rdf:type, that can be applied to instances of the Politician class
select distinct ?property
where {
?x a <http://dbpedia.org/ontology/Politician> .
?x ?property [].
FILTER (?property != rdf:type)
} LIMIT 1000

3. Which different values exist for the properties, except for rdf:type, applicable to the instances of Politician?
select distinct ?property ?value
where {
?x a <http://dbpedia.org/ontology/Politician> .
?x ?property ?value.
FILTER (?property != rdf:type)
} LIMIT 1000

4. For each of these applicable properties, except for rdf:type, which different values do they take globally for all those instances?
select distinct ?property ?valuesForAll
where {
?x a <http://dbpedia.org/ontology/Politician> .
?x ?property ?valuesForPoliticians.
?y ?property ?valuesForAll.
FILTER (?property != rdf:type)
} LIMIT 1000

5. For each of these applicable properties, except for rdf:type, how many distinct values do they take globally for all those instances?
select distinct ?valuesForAll
where {
?x a <http://dbpedia.org/ontology/Politician> .
?x ?property ?valuesForPoliticians.
?y ?property ?valuesForAll.
FILTER (?property != rdf:type)
} LIMIT 1000
NOTE: To obtain the Distinct values for each property, I considered using group by to group each property with their different values, but
DBpedia informed that query would take too long.
Binary file not shown.