How to get a class from QueryResults

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

How to get a class from QueryResults

Alex K.
Hi ,

I created a very simple owl and now I want to query that by using SPARQL lang. But I can't cast the associated object to a particular key.
The following code shows how I try to do it ! Would anyone please help me what am I doing wronge here ?

// The result of this query is {prs=SimpleInstance(Alice of [Cls(Person, FrameID(1:29922 1))])}

    QueryResults qr = owlModel.executeSPARQLQuery(query);
    while (qr.hasNext()){
          Map map = qr.next();
         System.out.println(map.toString());  
         if (map.containsKey("prs"))
              ??? = (???)map.get("prs"); // ??? Problem
            }

Thanks

Alex

Reply | Threaded
Open this post in threaded view
|

Remove me from the subscription list

David L. Watson
Please remove me from the subscription list.

Thanks,
David Watson
-------------------------------------------------------------------------
To unsubscribe go to http://protege.stanford.edu/community/subscribe.html