Re: Using RDF queries with beagle



Hi all,

> * Get the beagle-rdf branch [1]
> * Start beagled normally. For testing, disable indexing by 
> passing "--indexing-delay -1" to beagled.
> * To query for triples,
>   $ cd tools
>   $ gmcs RdfQueryTool.cs -r:../Util/Util.dll -r:../BeagleClient/Beagle.dll
>   $ export MONO_PATH=../Util/:../BeagleClient/
>   $ mono RdfQueryTool.exe <arg1> <arg2> <arg3> <arg4>
>     where arg1 = "" or uri (subject)
>           arg2 = "" or property-name (predicate)
>           arg3 = {Text,Keyword,Internal} (property-type, use any value of 
>                  arg2 is empty)
>           arg4 = "" or value (object)
>   => this will list the matching triples
here are some example queries, because it is not easy to get them right:
  mono RdfQueryTool.exe "" "" "" ""
returns all your indexed data as triples, here you can see what data you
have, so what you can query for. For instance:
  mono RdfQueryTool.exe "" "beagle:MimeType" "Keyword" ""
returns the mime-types of your indexed resources
  mono RdfQueryTool.exe "" "fixme:filesize" "Keyword" ""
returns all file sizes.

Further,
  mono RdfQueryTool.exe "uid:jQFjVL1tIE+OAnJArQhca" "" "" ""
should return everything about the resource 'uid:jQFjVL1tIE+OAnJArQhca',
  mono RdfQueryTool.exe "" "beagle:MimeType" "Keyword" "text/plain"
should return all resources that are of mime-type 'text/plain', and
  mono RdfQueryTool.exe "" "beagle:HitType" "Keyword" "File"
returns only files. However, those three queries do not work for me
right now :-(

In order to choose the right properties, you can
  cd beagled
  ./beagle-dump-index --fields
prints you all fields that exist in your indices. However, when
beagle-dump-index says
  [prop:k:beagle:MimeType]
then you have to query like
  mono RdfQueryTool.exe "" "beagle:MimeType" "Keyword" ""
So you skip the "prop:k:", and the "k" tells you that the type of this
property is "Keyword".

This is what dBera meant with "rough" ;-)

Cheers,
Enrico M.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]