On Sun, 2011-02-13 at 03:43 -0800, Lior Barnea wrote: 
> Hi all,
> 
> I tried to run the GenericRuleReasoner example I found in the "Jena 2 
> interface support page" and I get no results from the reasoner.
> 
> Following is my code:
> 
>             PrintUtil.registerPrefix("eg", "urn:x-hp:eg/");

> Model model = ModelFactory.createDefaultModel();
> 
>             model.setNsPrefix("eg", "urn:x-hp:eg/");
> 
>             Statement st;
>             Property p = model.createProperty("eg:p");
>             Resource objA = model.createResource("eg:A");
>             Resource objB = model.createResource("eg:B");
>             Resource objC = model.createResource("eg:C");
>             Resource objD = model.createResource("eg:D");

The argument to createResource/createProperty needs to be a full URI not
a curie/qname. Either declare a constant (such as EG) with your
namespace in and create the URIs by concatenation (EG + "A") or use
model.expandPrefix to convert your qname form to full URIs.

Dave


Reply via email to