Re: [foaf-dev] SPARQL Querying CCO
Bob Ferris <zazi-o0kiOr3Ba/[email protected]> Mon, 30 May 2011 20:42:09 +0200
| Newsgroups | gmane.comp.web.rdfweb |
|---|---|
| Message-ID | <[email protected]> |
Hi Rob,
On 5/30/2011 7:58 PM, Rob Stewart wrote:
> Hi Bob,
>
> Thanks. OK, would it be possible then to generate some RDF, so as we
> can weight foaf:knows. e.g. So that the following SPARQL query will
> give us the weights:
>
> PREFIX foaf:<http://xmlns.com/foaf/0.1/>
> PREFIX cco:<http://purl.org/ontology/cco/core#>
> PREFIX wo:<http://purl.org/ontology/wo/core#>
> PREFIX ex:<http://example.org/>
> SELECT ?name ?friendname ?wv
> WHERE
> { ?x foaf:name ?name .
> ?x cco:habit ?h .
> ?h cco:topic ?otherPerson .
> ?h cco:characteristic foaf:knows .
> ?otherPerson foaf:name ?friendname .
> ?h wo:weight ?w .
> ?w wo:weight_value ?wv . }
Well, I wouldn't really count a 'knows' relation as a cognitive pattern,
or? However, you can create similar, detailed descriptions for a 'knows'
relation on basis of an appropriated reification class (in the following
example this is ex:HumanRelationship), e.g.,
# the shortcut relation
<#alice> foaf:knows <#bob> .
# the reification class instance
<#ab>
a ex:HumanRelationship ;
ex:participant <#alice>, <#bob> ;
ex:relationshipType foaf:knows ;
wo:weight [
a wo:Weight ;
wo:weight_value 9.0 ;
wo:scale ex:AScale
] ;
ex:since "2008-04"^^xsd:gYearMonth .
<#alice> ex:relationship <#ab> .
# the SPARQL query
PREFIX foaf:<http://xmlns.com/foaf/0.1/>
PREFIX cco:<http://purl.org/ontology/cco/core#>
PREFIX wo:<http://purl.org/ontology/wo/core#>
PREFIX ex:<http://example.org/>
SELECT ?name ?friendname ?wv
WHERE
{ ?x foaf:name ?name .
?x ex:relationship ?r .
?r ex:participant ?person .
?r ex:relationshipType foaf:knows .
?person foaf:name ?friendname .
?r wo:weight ?w .
?w wo:weight_value ?wv . }
>
>
> Or is WO: truly only to represent weighted interests (all of the
> examples on [1] are related to interests).
The Weighting Ontology is a domain independent ontology for representing
weightings*. The examples on [1] demonstrate the utilisation of WO in
the context of cognitive pattern modelling examples that are based on
the Cognitive Characteristic Ontology.
Cheers,
Bob
PS: The issues that the Property Reification Vocabulary [2] is intended
to cover is the ability to create property reification definitions that
describe the semantic relation between specific shortcut relations and
related reification class instances (that describe a concrete shortcut
relation more in detail)
*) separation of concerns and modularization should be/is a preferred
ontology design principle
>
> 1 - http://smiy.sourceforge.net/cco/spec/cognitivecharacteristics.html
[2] http://purl.org/ontology/prv/core#