Re: Jena infer example

Hi all,

although it is not clear in the documentation, taking a look at the source
code [1], VOCAB seems to be the file containing the base vocabulary for the
reasoning process. The rest of the FILE parameters should be the files
containing the individuals. So if you have data1.rdf and data2.rdf
containing FOAF-based annotations, your CLI would be:

C:\Programs\apache-jena-3.1.0>infer foaf.owl data1.rdf data2.rdf

Let me know if this works so as to contribute it to the Jena documentation
(which should be more clear).

Best,
Idafen


[1]
https://github.com/apache/jena/blob/master/jena-cmds/src/main/java/riotcmd/infer.java

On Mon, Oct 3, 2016 at 3:15 PM, Mark Wallace <mwallace@modusoperandi.com>
wrote:

> Hi Andy,
>
>
> I thought about the jena list, but since someone recently posted inquiring
> about a command-line tools for inferring, I'm hoping this is relevant to
> other subscribers.
>
>
> Your response doesn't my question just yet.  I know what RDFS is, :-), but
> I don't know what are valid values for VOCAB,
>
>
> E.g.,
>
>
> C:\Programs\apache-jena-3.1.0>infer
> Required argument missing: --rdfs
>
> C:\Programs\apache-jena-3.1.0>infer --rdfs
> java.lang.IllegalArgumentException: No value for argument: rdfs
>         at jena.cmd.CmdLineArgs.addArgWorker(CmdLineArgs.java:133)
>         at jena.cmd.CmdLineArgs.addArg(CmdLineArgs.java:122)
>         at jena.cmd.CmdLineArgs$ArgProcessor.arg(CmdLineArgs.java:407)
>         at jena.cmd.CommandLineBase.lambda$apply$0(
> CommandLineBase.java:54)
>         at java.util.stream.Streams$RangeIntSpliterator.
> forEachRemaining(Streams.java:110)
>         at java.util.stream.IntPipeline$Head.forEach(IntPipeline.java:557)
>         at jena.cmd.CommandLineBase.apply(CommandLineBase.java:54)
>         at jena.cmd.CmdLineArgs.process(CmdLineArgs.java:52)
>         at jena.cmd.CmdArgModule.process(CmdArgModule.java:44)
>         at jena.cmd.CmdMain.mainMethod(CmdMain.java:92)
>         at jena.cmd.CmdMain.mainRun(CmdMain.java:58)
>         at jena.cmd.CmdMain.mainRun(CmdMain.java:45)
>         at riotcmd.infer.main(infer.java:92)
>
> C:\Programs\apache-jena-3.1.0>infer --rdfs x
> org.apache.jena.riot.RiotNotFoundException: Not found: x
>         at org.apache.jena.riot.RDFDataMgr.open(RDFDataMgr.java:836)
>         at org.apache.jena.riot.RDFDataMgr.open(RDFDataMgr.java:820)
>         at org.apache.jena.riot.RDFDataMgr.parse(RDFDataMgr.java:664)
>         at org.apache.jena.riot.RDFDataMgr.read(RDFDataMgr.java:212)
>         at org.apache.jena.riot.RDFDataMgr.read(RDFDataMgr.java:145)
>         at org.apache.jena.riot.RDFDataMgr.read(RDFDataMgr.java:134)
>         at org.apache.jena.riot.adapters.AdapterFileManager.
> readModelWorker(AdapterFileManager.java:282)
>         at org.apache.jena.util.FileManager.loadModelWorker(
> FileManager.java:305)
>         at org.apache.jena.util.FileManager.loadModel(
> FileManager.java:258)
>         at riotcmd.infer.processModulesAndArgs(infer.java:121)
>         at jena.cmd.CmdArgModule.process(CmdArgModule.java:52)
>         at jena.cmd.CmdMain.mainMethod(CmdMain.java:92)
>         at jena.cmd.CmdMain.mainRun(CmdMain.java:58)
>         at jena.cmd.CmdMain.mainRun(CmdMain.java:45)
>         at riotcmd.infer.main(infer.java:92)
>
> C:\Programs\apache-jena-3.1.0>infer --rdfs OWLmicro
> org.apache.jena.riot.RiotNotFoundException: Not found: OWLmicro
>         at org.apache.jena.riot.RDFDataMgr.open(RDFDataMgr.java:836)
>         at org.apache.jena.riot.RDFDataMgr.open(RDFDataMgr.java:820)
>         at org.apache.jena.riot.RDFDataMgr.parse(RDFDataMgr.java:664)
>         at org.apache.jena.riot.RDFDataMgr.read(RDFDataMgr.java:212)
>         at org.apache.jena.riot.RDFDataMgr.read(RDFDataMgr.java:145)
>         at org.apache.jena.riot.RDFDataMgr.read(RDFDataMgr.java:134)
>         at org.apache.jena.riot.adapters.AdapterFileManager.
> readModelWorker(AdapterFileManager.java:282)
>         at org.apache.jena.util.FileManager.loadModelWorker(
> FileManager.java:305)
>         at org.apache.jena.util.FileManager.loadModel(
> FileManager.java:258)
>         at riotcmd.infer.processModulesAndArgs(infer.java:121)
>         at jena.cmd.CmdArgModule.process(CmdArgModule.java:52)
>         at jena.cmd.CmdMain.mainMethod(CmdMain.java:92)
>         at jena.cmd.CmdMain.mainRun(CmdMain.java:58)
>         at jena.cmd.CmdMain.mainRun(CmdMain.java:45)
>         at riotcmd.infer.main(infer.java:92)
>
> C:\Programs\apache-jena-3.1.0>
>
>
> What values can I put in for VOCAB?
>
>
>  -Mark
>
>
>
> ------------------------------
> *From:* Andy Seaborne <andy@apache.org>
> *Sent:* Sunday, October 2, 2016 5:58:13 PM
> *To:* semantic-web@w3.org
> *Subject:* Re: Jena infer example
>
>
>
> On 02/10/16 21:35, Mark Wallace wrote:
> > Can someone provide a sample invocation of Jena's infer command?
>
> Probably better on the users@jena.apache.org mailing list.
>
> >  Documentation [1] says this:
> >
> >
> > riotcmd.infer --rdfs VOCAB FILE FILE ...
> >
> >
> > but doesn't give example examples of what VOCAB is.
>
> The RDFS schema - subclass, subproperty range and domain declarations.
>
> It is applied to FILEs to produce a stream of output of ground and
> inferred data.
>
>         Andy
>
>


-- 
PhD, Ontology Engineering Group

Received on Monday, 3 October 2016 13:44:25 UTC