Skip to first unread message

Pedro Ferreira

unread,
Jan 22, 2015, 2:29:52 AM1/22/15
to swi-p...@googlegroups.com
Hi there,

I'm doing a project that uses prolog and we are considering using SWI-Prolog as the main Prolog engine.

My question is:

where do the prolog session data resides ? on memory? or on disk?

I would like to be able to let the session "persistent", like a database, that can restore its state after a system reboot, for example.

Anyone knows if this is handled in SWI-Prolog?

THank you,

Pedro Ferreira.

Anne Ogborn

unread,
Jan 22, 2015, 3:43:57 AM1/22/15
to Pedro Ferreira, swi-p...@googlegroups.com
The prolog database is stored in memory.

You can arrange to have it copied to disk automatically by using
library(persistancy).

http://www.swi-prolog.org/pldoc/doc/swi/library/persistency.pl

How big is 'very huge'? Dell sells a blade server with 768GB/blade max.....
If you're reasoning about data bigger than that, you're probably going to have to segment somehow
for speed reasons anyway.

You'll want to use tables
http://www.swi-prolog.org/pldoc/doc_for?object=section(%27packages/table.html%27)


It's simple enough to make a model of your data store and generate an appropriate number of dummy records.

Threads Monitor will tell you about memory usage in real time, so you can see which of global/local/trail memory limits you need to increase.

You can set the memory consumption with command line switches at start or by set_prolog_stack/2

http://www.swi-prolog.org/pldoc/man?section=stacksizes

http://www.swi-prolog.org/pldoc/man?section=running-options




________________________________
From: Pedro Ferreira <pedr...@gmail.com>
To: swi-p...@googlegroups.com
Sent: Wednesday, January 21, 2015 11:29 PM
Subject: [SWIPL] Prolog and very huge logic databases
--
You received this message because you are subscribed to the Google Groups "SWI-Prolog" group.
To unsubscribe from this group and stop receiving emails from it, send an email to swi-prolog+...@googlegroups.com.
Visit this group at http://groups.google.com/group/swi-prolog.
For more options, visit https://groups.google.com/d/optout.

Pedro Ferreira

unread,
Jan 22, 2015, 3:51:14 AM1/22/15
to Anne Ogborn, swi-p...@googlegroups.com
For huge, I mean very huge.

Probably Gigabytes or Terabytes of data. Full data in Memory is not an
option.

I saw something about tables, I will take a deeper look.

Thanks,

Pedro Ferreira.

Jan Wielemaker

unread,
Jan 22, 2015, 6:00:57 AM1/22/15
to Pedro Ferreira, Anne Ogborn, swi-p...@googlegroups.com
On 01/22/2015 09:51 AM, Pedro Ferreira wrote:
> For huge, I mean very huge.
>
> Probably Gigabytes or Terabytes of data. Full data in Memory is not an
> option.
>
> I saw something about tables, I will take a deeper look.

Tables are basically only suitable for static data that must be accessed
on a single primary key which can be sorted (not necessarily unique).
You could use it for dynamic data if you can keep the sorted structure
by only adding new data at the end. Not sure whether the library
handles dynamic data changes though. I used it long ago to store
background knowledge in the days we had like a few 100 Mb main memory.

If Prolog itself doesn't suffice and your data is dynamic, you need to
access a proper DB. So, you have interfaces to BerkelyDB, sqllite or
distributed solutions through ODBC, optionally using CQL for nice and
clean access to complicated databases. Of course, you could use these
as background storage and cache life data in the Prolog database. That
will require a bit of programming, but might provide excellent performance.

Success --- Jan

Pedro Ferreira

unread,
Jan 22, 2015, 6:48:13 AM1/22/15
to Jan Wielemaker, Anne Ogborn, swi-p...@googlegroups.com
Hi Jan,

For what I seen, tables are like acessing relational databases in
Prolog... this wouldn't solve the problem correctly. The scope is
building a generic ontologic-based database - very huge, linking
keywords/binary data and facts as a graph or a multigraph.

I'm starting to think Prolog is no more an option for this scope.

Thanks for the clarification.

Success too,

Pedro Ferreira.

Carlo Capelli

unread,
Jan 22, 2015, 6:58:59 AM1/22/15
to Pedro Ferreira, Jan Wielemaker, Anne Ogborn, swi-p...@googlegroups.com
Hi Pedro

I think Jan didn't pointed out the exceptional ontologic capability of SWI-Prolog for an excess of modesty...
Indeed, you didn't indicated in first place that RDF structured data is an option for you.

Carlo

--
You received this message because you are subscribed to the Google Groups "SWI-Prolog" group.
To unsubscribe from this group and stop receiving emails from it, send an email to swi-prolog+unsubscribe@googlegroups.com.

Jose F. Morales

unread,
Jan 22, 2015, 6:59:30 AM1/22/15
to Pedro Ferreira, Jan Wielemaker, Anne Ogborn, swi-p...@googlegroups.com
Hi Pedro,

If you like Prolog as higher level abstraction for your problem, you may also consider:


I am not sure if there is a public Yap Prolog release where it is available (you should contact the authors).

Cheers

--
You received this message because you are subscribed to the Google Groups "SWI-Prolog" group.
To unsubscribe from this group and stop receiving emails from it, send an email to swi-prolog+unsubscribe@googlegroups.com.



--
Jose

Pedro Ferreira

unread,
Jan 22, 2015, 7:04:50 AM1/22/15
to Jose F. Morales, Jan Wielemaker, Anne Ogborn, swi-p...@googlegroups.com
Hi Jose,

Thank you!

It's was something like that I was looking for.

I will check if it's available.

Thanks you very much,

Pedro Ferreira.
To unsubscribe from this group and stop receiving emails from it, send an email to swi-prolog+...@googlegroups.com.



--
Jose

Carlo Capelli

unread,
Jan 22, 2015, 7:09:24 AM1/22/15
to Pedro Ferreira, Jan Wielemaker, Anne Ogborn, swi-p...@googlegroups.com
oops, pardon,,, actually was clearly indicated the ontologic structure...

Pedro Ferreira

unread,
Jan 22, 2015, 7:29:55 AM1/22/15
to Carlo Capelli, Jan Wielemaker, Anne Ogborn, swi-p...@googlegroups.com
Hi People,

who is from the open source world, I would like to let my invite to collaborate into our project,

be with ideas, or even coding.

After the kernel (OpenSource) is ready, there will be a lot of space for commercial applications.

Any question you can add me on ResearchGate (Pedro Ferreira) or contact me at my corporative e-mail address (pedro.f...@egypteam.com)

Success for all,

Pedro Ferreira
AI-Board / Khalid Developer.
To unsubscribe from this group and stop receiving emails from it, send an email to swi-prolog+...@googlegroups.com.

Anne Ogborn

unread,
Jan 22, 2015, 9:55:14 PM1/22/15
to Pedro Ferreira, Carlo Capelli, Jan Wielemaker, swi-p...@googlegroups.com
I would second Carlo's observation.

SWI-Prolog's a great tool for workign with RDF data. Your application might reasonably be a distributed set of SWI-Prolog specialists that collectively reason about a large RDF store.

Cliopatria is a SPARQL server written in SWI-Prolog. Beyond that, SWI-Prolog itself has a lot of support for
semantic web stuff - it understands prefixes like foaf:name and has persistance and lots of other goodies.
type rdf into the search box on the swi-prolog.org website for a plethora of semweb fun.

Pedro Ferreira

unread,
Jan 22, 2015, 10:01:53 PM1/22/15
to Carlo Capelli, Jan Wielemaker, Anne Ogborn, swi-p...@googlegroups.com
Hi Carlo,

Thanks!

I'm using currently SWI-Prolog, although I'm leaving space for a kind of logic ORM (support using different engines)

RDF is very similar to what the application needs.

Thanks,

Pedro.
To unsubscribe from this group and stop receiving emails from it, send an email to swi-prolog+...@googlegroups.com.

Pedro Ferreira

unread,
Jan 22, 2015, 10:02:41 PM1/22/15
to Carlo Capelli, Jan Wielemaker, Anne Ogborn, swi-p...@googlegroups.com
Yes, no problem.


On 22-01-2015 09:09, Carlo Capelli wrote:
To unsubscribe from this group and stop receiving emails from it, send an email to swi-prolog+...@googlegroups.com.

Pedro Ferreira

unread,
Jan 22, 2015, 10:13:48 PM1/22/15
to Anne Ogborn, Carlo Capelli, Jan Wielemaker, swi-p...@googlegroups.com
Thank you Anne.

This tip is very useful.

Anne Ogborn

unread,
Jan 22, 2015, 10:19:36 PM1/22/15
to Pedro Ferreira, Carlo Capelli, Jan Wielemaker, swi-p...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages