Thanks for your reply. I have a follow up question.

I've successfully created a CustomBuiltinAssembler that 'opens' the custom 
builtin's and loads them into the BuiltinRegistry. So, if I use the statement:

Assembler.general.open(truckRoot);

to explicitly open those resources (and load them in the BuiltinRegistry) from 
the Assembler specs, it works like expected.

However, in Apache Jena Fuseki the custom builtin's do not get loaded from a 
configuration file. I suspect this happens because Fuseki only tries to open 
'services' and everything related to them and does not try to load any dangling 
resources (like my CustomBuiltin's). Because I rather not extend the existing 
InfModelAssembler of Apache Jena, I have no way of connect my CustomBuiltin's 
to the services resource. My current Assembler specs can be found below.

Am I right that my CustomBuiltin's need to be connected to a Fuseki service to 
get loaded? And is there some way to achieve this without extending some 
existing Assember?

Kind regards,

Barry Nouwt


@prefix : <http://www.example.org/tno#> .
@prefix fuseki: <http://jena.apache.org/fuseki#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix tdb: <http://jena.hpl.hp.com/2008/tdb#> .
@prefix ja: <http://jena.hpl.hp.com/2005/11/Assembler#> .

tdb:DatasetTDB rdfs:subClassOf ja:RDFDataset .
tdb:GraphTDB rdfs:subClassOf ja:Model .

:CustomBuiltin rdfs:subClassOf ja:Object ;
        ja:assembler "nl.tno.ds.cb.CustomBuiltinAssembler" .

:shipCustom a :CustomBuiltin ;
        :hasClass "nl.tno.ds.cb.FirstBuiltin" .
        
:truckCustom a :CustomBuiltin ;
        :hasClass "nl.tno.ds.cb.SecondBuiltin" .

:dataset rdf:type ja:RDFDataset ;
        ja:defaultGraph <#infGraph> .

<#infGraph>  rdf:type ja:InfModel ;
             ja:reasoner [ ja:rulesFrom <file:src/test/resources/et.rules> ; ] ;
             ja:content <#test-inf> .

<#test-inf> ja:externalContent <src/test/resources/data.ttl> .

-----Original Message-----
From: ajs6f [mailto:[email protected]] 
Sent: zaterdag 25 november 2017 15:45
To: [email protected]
Subject: Re: Assembler for GenericRuleEngine Custom Builtin

I'm not too familiar with the rules system, so I may be wrong, but I think the 
answer is simply no, we don't have that feature right now. It does sound quite 
useful. If you write this code for yourself please do open a ticket (actually, 
that would be nice in any event) and send a PR!

For anyone who may be wondering about programmatic use of custom built-ins, 
there is a test case here:

org.apache.jena.reasoner.rulesys.test.TestGenericRuleReasonerConfig.testRuleLoadingWithOverridenBuiltins()


ajs6f

> On Nov 24, 2017, at 11:26 AM, Nouwt, B. (Barry) <[email protected]> wrote:
> 
> Hi all,
> 
> Does anyone know whether there is an Assember to load a custom Builtin (for 
> usage in rules for the GenericRuleEngine) using a Fuseki configuration .ttl 
> file. I assume not, because I cannot find it in: 
> https://github.com/apache/jena/tree/master/jena-core/src/main/java/org/apache/jena/assembler/assemblers
> 
> I do see a RuleSetAssembler and a ReasonerFactory, but they do not seem to 
> have a Builtin load option. Also, via code I use the BuiltinRegistry class, 
> so it would probably be not too difficult to add this feature myself.
> 
> Any pointers?
> 
> Regards, Barry
> 
> 
> 
> 
> This message may contain information that is not intended for you. If you are 
> not the addressee or if this message was sent to you by mistake, you are 
> requested to inform the sender and delete the message. TNO accepts no 
> liability for the content of this e-mail, for the manner in which you use it 
> and for damage of any kind resulting from the risks inherent to the 
> electronic transmission of messages.

Reply via email to