Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » SeMantic Information Logistics Architecture (SMILA) » Creating record with blackboard and saving
Creating record with blackboard and saving [message #564705] Thu, 05 August 2010 14:09 Go to next message
SMILANewBee is currently offline SMILANewBeeFriend
Messages: 42
Registered: August 2010
Member
Hello,

I want to create a new record within a Pipelet and saving the record to the blackboard. After that the new record should be find by a search engine. I have created a new id with the IdFactory, create a new record with the coressponding blackboard method, create new literals and call the commit-method of the blackboard for that specific id. But this doesn't work. The new record isn't found by the search engine.

Here is my code:

Quote:
> String filename = blackboard.getLiteral(id, new Path("Filename")).getStringValue();
> String lastModifiedDate = blackboard.getLiteral(id, new Path("LastModifiedDate")).getStringValue();
>
> IdFactory idFactory = IdFactory.DEFAULT_INSTANCE;
> Key newKey = idFactory.createKey(filename, lastModifiedDate);
> Id newId = idFactory.createId("file", newKey);
>
> blackboard.create(newId);
>
> Literal newLiteralACount = RecordFactory.DEFAULT_INSTANCE.createLiteral();
> newLiteralACount.setIntValue(countChar(content.getStringValu e(), 'a'));
> blackboard.setLiteral(newId, new Path("ACount"), newLiteralACount);
>
> Literal newLiteralFilename = RecordFactory.DEFAULT_INSTANCE.createLiteral();
> newLiteralFilename.setStringValue(filename);
> blackboard.setLiteral(newId, new Path("Filename"), newLiteralFilename);


Can someone help me?
Re: Creating record with blackboard and saving [message #564729 is a reply to message #564705] Mon, 09 August 2010 12:29 Go to previous message
Eclipse UserFriend
Originally posted by: juergen.schumacher.attensity.com

Hi Nils,

Am 05.08.2010, 16:09 Uhr, schrieb <nils.thieme@unister.de>:
> Hello,
>
> I want to create a new record within a Pipelet and saving the record to
> the blackboard. After that the new record should be find by a search
> engine. I have created a new id with the IdFactory, create a new record
> with the coressponding blackboard method, create new literals and call
> the commit-method of the blackboard for that specific id. But this
> doesn't work. The new record isn't found by the search engine.
>
> Here is my code:
>
> Quote:
> [...code...]
> Can someone help me?

Sorry for the late answer, the setup for the news server on my new
computer was not yet correct, so I didn't see your post (;

The code looks OK to me. However, you don't need to call the commit method
yourself, that is handled by the framework, but
it also should not cause problems (performance maybe).

Some other reasons for problems I can think of:
Does your pipelet also return the newId as part of the result Id[] of the
process() method?
Usually this ID list is passed to the next pipelet or service in the
workflow and the next pipelet works only with the
IDs passed to it.

Another question: Do you really want to create a new record, or do you
rather want to add additional attributes to the input record?
Most pipelets work this way and do not create new records.

And finally the definition of the search index must contain something for
your new attribute so that Lucene uses it for indexing.

Regards,
Juergen.
Previous Topic:Semantic Part in SMILA
Next Topic:Creating record with blackboard and saving
Goto Forum:
  


Current Time: Thu Dec 18 15:37:45 GMT 2014

Powered by FUDForum. Page generated in 0.01530 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software