Apparently sparql doesn't allow non aggregate variables in the select clause unless they are also in the group by, which affects the query's meaning. So I came up with another solution which includes an intersection(join):
select ?country ?area ?lake
where {
?lake rdfs:label ?label .
?lake rdf:type dbo:Lake .
?lake dbo:areaTotal ?area .
?lake dbo:country ?country .
?country rdf:type dbo:Country .
FILTER (lang(?label) = 'en') .
FILTER(?maxarea = ?area)
{
select ?country (MAX(?area) AS ?maxarea)
where {
?lake rdfs:label ?label .
?lake rdf:type dbo:Lake .
?lake dbo:areaTotal ?area .
?lake dbo:country ?country .
?country rdf:type dbo:Country .
FILTER (lang(?label) = 'en') .
}
group by ?country
}
}
Here is an example solution on how to define a data property restriction in OWL:
DataPropertyRange>
DataProperty IRI="#has_Age"/>
Datatype abbreviatedIRI="xsd:integer"/>
FacetRestriction facet="http://www.w3.org/2001/XMLSchema#minInclusive">
Literal datatypeIRI="http://www.w3.org/2001/XMLSchema#integer">0
/FacetRestriction>
/DataPropertyRange>
in this example the data property we are looking at is called "has_Age" and we give it the properties "integer" with the third line. With the FacetRestriction in line 4 we set a minimum restriction and in line 5 we define this minimum to be 0 as a person cannot be "negative old".
edit: I had to remove all of the opening braces "<" from my solution because there was issues with the parsers.
Another good reasoner to be used in Protege is Pellet. You can download it from http://clarkparsia.com/pellet/
Open Protégé and the respective ontology.
Change to the "Classes" tab and create the class.
Change to the "Individuals" tab and create the individual.
Protégé recognizes that the IRI already exists and accepts it.
Instead of OWL DL, we have other two version : OWL EL and OWL FULL.
OWL EL is less expressive than OWL DL and OWL FULL, but the complexity is quite nice.
For OWL FULL, we can use both syntax in RDF and in OWL