Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [higgins-dev] Updated example ontologies

Just to round out the picture, here are two ways to access that phone number:
 
Assuming I have an IDigitalSubject called ds which represents a person having such a value, I would examine that value like this (assumes there's only one phone number value):
 
// IdAS consumer had to use the schema to associate person:homePhone (ultimately) with xsd:string, and thus Java String
String phoneNum =  (String)ds.getAttribute.("person:homePhone").getValue().getData();
 
// Something more generic, requiring no apriori schema knowledge
ISimpleValue val = ds.getAttribute.("person:homePhone").getValue();
if (val.isSimple) {
    String valStr =  val.getLexical();
} else {
    processComplex((IComplexValue)val);
}
 
Note that the first example requires the consumer to map from person:homePhone to xsd:string. The second requires no schema knowledge.
 

>>> Greg Byrd <gbyrd@xxxxxxxx> 10/3/06 11:28 AM >>>
Tom Doman wrote:
> <snip>
>
> Could you give us an example SPARQL query for your example instance where we select all instances where "homePhone" == "555-1212"?  My main purpose right now is to look at how to convert SPARQL queries into LDAP filters.
>
> -Tom
>  

I think it would be something like this:

BASE <uri that we're searching>
PREFIX person:
<http://www.eclipse.org/higgins/ontologies/2006/test-person.owl#>
PREFIX higgins:
<http://www.eclipse.org/higgins/ontologies/2006/higgins.owl#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>
SELECT ?x
{{?x person:homePhone _:phone}
  {_:phone higgins:normalizedStringSimpleValue
"555-1212"^^xsd:normalizedString }}








_______________________________________________
higgins-dev mailing list
higgins-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/higgins-dev

Back to the top