Pharo-users
By thread
pharo-users@lists.pharo.org
By month
Messages by month
- ----- 2026 -----
- July
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
September 2013
- 60 participants
- 358 messages
Re: [Pharo-users] Scoped Senders
by Goubier Thierry
In AltBrowser, double click on the package you want, in the resulting
package-scoped browser, choose the method and select sendersOf in the
context menu :)
(It may not be working completely at the moment)
By hand, write the following.
Create a RBEnvironment:
| rbp |
rbp := RBBrowserEnvironment new forPackages: { }.
Then do the senders search on it:
rbp referencesTo: aSelector in: rbp
Thierry
Le 26/09/2013 16:39, Sean P. DeNigris a écrit :
> How do I find the senders of a message, but just in a certain set of
> packages?
>
> Thanks.
>
>
>
> -----
> Cheers,
> Sean
> --
> View this message in context: http://forum.world.st/Scoped-Senders-tp4710563.html
> Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
>
>
>
--
Thierry Goubier
CEA list
Laboratoire des Fondations des Systèmes Temps Réel Embarqués
91191 Gif sur Yvette Cedex
France
Phone/Fax: +33 (0) 1 69 08 32 92 / 83 95
Sept. 26, 2013
Re: [Pharo-users] Scoped Senders
by Camillo Bruni
=> create a refactoring scope (I don't know the menu entry, but the shortcut is: CMD-B CMD-R CMD-R (browse restricted regular expression)
if you look for senders there you will only see the ones in your current scope.
I am currently working on getting a nice scope/environment selector working that we
then can add to all tools like senders / implementors and refactorings.
On 2013-09-26, at 11:39, "Sean P. DeNigris" <sean(a)clipperadams.com> wrote:
> How do I find the senders of a message, but just in a certain set of
> packages?
>
> Thanks.
>
>
>
> -----
> Cheers,
> Sean
> --
> View this message in context: http://forum.world.st/Scoped-Senders-tp4710563.html
> Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
>
Sept. 26, 2013
Scoped Senders
by Sean P. DeNigris
How do I find the senders of a message, but just in a certain set of
packages?
Thanks.
-----
Cheers,
Sean
--
View this message in context: http://forum.world.st/Scoped-Senders-tp4710563.html
Sent from the Pharo Smalltalk Users mailing list archive at Nabble.com.
Sept. 26, 2013
NeoJSON and inheritance
by Norbert Hartl
How is inheritance supposed to work in NeoJSON? I only figured it out by doing that manually:
neoJsonMapping: aMapper
super neoJsonMapping: aMapper.
(aMapper mappingFor: self)
mapInstVar: #longitude;
mapInstVar: #latitude.
Is there a better way to do?
Norbert
Sept. 26, 2013
A simple File browser ?
by Erwan Douaille
Hi,
I would like to know if something like, a file browser ui containing a
select button, exist ?
Something really simple, just for browse and select one file. In my case i
need it for import new icons.
Thanks :)
--
Best regards,
Douaille Erwan <douaille.erwan(a)gmail.com>
Sept. 26, 2013
Re: [Pharo-users] Snapshotcello & Pharo 20: issues...
by Tudor Girba
Strange. I've never encountered this.
each should be a MCWorkingCopy.
I will try to take a look, but it might take a while.
In the meantime, can you locate the package in your configuration? Is it
possible that something went wrong with Monticello?
Cheers,
Doru
On Wed, Sep 25, 2013 at 9:29 PM, Stéphane Ducasse <stephane.ducasse(a)inria.fr
> wrote:
> this is strange since I could snapshot moose and synectique using it.
>
> I'm about to write a boring report so I'm not allowed to open Pharo right
> now.
>
> I am giving a shot at Snapshotcello since it looks like a superb solution
> for creating images properly from a complex configuration.
>
> From
> http://www.tudorgirba.com/blog/snapshotcello-take-a-snapshot-when-you-re-re…,
> I tried to craft a call for my configuration.
>
> I've loaded ConfigurationOfSnapshotcello #development in Pharo20.
>
> Then tried the calls and there were some API changes (from the tests, I
> found out the incantation).
>
> Snapshotcello new
> configurationClass: ConfigurationOfHOWebStack;
> sourceVersion: #development;
> targetVersion: '0.3-snapshot';
> snapshot.
>
> But then I faced a problem with a DNU on 'asEnglishPlural' for a
> categorization. No big deal, I commented that out as I could live with that.
>
> But then I faced something more difficult (the
> compileSnapshotWithCurrentPackages: aNumber worked in the self
> generateSnapshotWithCurrentPackages: aNumber...
>
>
> It took a lot of time to get the whole config loaded... (so, the
> progressbars worked and worked)
>
> Then, it failed on giving: "PostMortem: MNU: nil>>ancestry"
>
> self workingCopiesFromConfiguration do: [ :each | codeStream tab; tab;
> nextPutAll: '#('; nextPut: $'; nextPutAll: *each ancestry ancestorString*;
> nextPutAll: '.mcz'; nextPut: $'; nextPutAll: ' '; nextPut: $'; nextPutAll:
> (self repositoryNameForWorkingCopy: each); nextPut: $'; nextPutAll: ' ';
> nextPut: $'; nextPutAll: each package name; nextPut: $'; nextPutAll: ' ) '
> ] separatedBy: [ codeStream cr ]. codeStream cr; tab; nextPutAll: ')'. ^
> codeStream contents
>
> Oops. each is nil...
>
> Anyone having faced that?
>
> Debugging...
>
> Phil
>
>
>
--
www.tudorgirba.com
"Every thing has its own flow"
Sept. 26, 2013
Re: [Pharo-users] How to load seaside currently?
by Stephan Eggermont
Philippe wrote:
>FWIW, that ConfigurationOfSeaside3 leads to all kinds of problems when coupled with MagritteMagic and TwitterBoostrap...
>The fact that those are loading Seaside30 on their own isn't helping... That name change may not have been the best thing (keeping 30 would have been better IMV).
You might want to compare with the QCMagritte build on CI. That works with TwitterBootstrap.
Stephan
Sept. 25, 2013
Re: [Pharo-users] Semantic web packages
by Jesus Nuñez
In the section *SOUL versus PROLOG* of
http://soft.vub.ac.be/Publications/2000/vub-prog-phd-00-02.pdf, the autor
says:
When switching from SOUL to Prolog, we actually extended the SOUL system to
> export all SOUL code in Prolog format. More recent versions of the SOUL
> system include an option to use Prolog syntax instead of SOUL
> syntax and to switch between both notations. All logic code fragments in
> this dissertation are shown in Prolog-syntax
It is currently possible to achieve this in Pharo? It so, could you please
provide an example?. I could forget about the syntax and learn it if this
is possible.
Cheers,
Jesus
2013/9/25 Jesus Nuñez <poissonbreaker(a)gmail.com>
> Sorry, I hate its syntax, too verbose for my taste. What about dynamic
> modules, DCG, CHR, CLP, performance in general?. What about
> meta-programming, operator declarations. Do you really thing SOUL is a good
> replacement for Prolog?, I do not see the expressiveness of Prolog
> reflected in what I have seen. What about the libraries I mentioned for
> semantic web?
>
> Think now about Prolog and the Helvetia approach, don't you thing it would
> be much more attractive for newcommers or people who already knows Prolog?
> If you put both approaches over the table I woudn't hesitate in taking the
> Helvetia approach.
>
> Cheers,
> Jesus
>
>
> 2013/9/25 Jesus Nuñez <poissonbreaker(a)gmail.com>
>
>> OK I found it, I'll have a look
>>
>>
>> 2013/9/25 Jesus Nuñez <poissonbreaker(a)gmail.com>
>>
>>> where is it??
>>>
>>>
>>> 2013/9/25 Stéphane Ducasse <stephane.ducasse(a)inria.fr>
>>>
>>>> did you look at SOUL?
>>>>
>>>> Stef
>>>>
>>>> On Sep 25, 2013, at 9:15 PM, Jesus Nuñez <poissonbreaker(a)gmail.com>
>>>> wrote:
>>>>
>>>> In my very first attempt, I tried to port a package which sounds to me
>>>> like the one you describe. In the examples there was a snoopy world as a
>>>> search example, maybe you recall it from that. However I realized that I
>>>> didn't want to emulate Prolog in Pharo; nothing like fast compiled and
>>>> optimized code for WAM.
>>>>
>>>> The idea was to emulate the language boxes of Helvetia to mix Prolog
>>>> and Smalltalk code and use NativeBoost to call the swi-prolog shared
>>>> library, so I could use a highly deployed version of Prolog. Some time ago
>>>> I made an inquiry and for handling some text highlighting issues that would
>>>> help in my aims, just for a direct reference, the code is below:
>>>>
>>>> | text textRenderer textShower |
>>>>> text := 'p(Q,R):-q(R), unify_st(X, smalltalk_code), r(T).
>>>>> q(Q):-d(R).
>>>>> q(Q).'.
>>>>> textRenderer := [
>>>>> PPTextHighlighter new
>>>>> parser: PPPrologParser new;
>>>>> color: 'small_atom' with: Color blue muchDarker;
>>>>> bold: 'small_atom';
>>>>> color: 'unify_st' with: Color green muchDarker;
>>>>> bold: 'unify_st';
>>>>> color: 'string' with: Color gray muchDarker;
>>>>> color: 'number' with: Color gray muchDarker;
>>>>> color: 'boolean' with: Color gray muchDarker;
>>>>> highlight: text asText.
>>>>> ].
>>>>> " __
>>>>> |
>>>>> <Renders IN>
>>>>> |
>>>>> W
>>>>> GLMTextPresentation
>>>>> |
>>>>> <Renders IN>
>>>>> |
>>>>> W
>>>>> GLMMorphicRenderer
>>>>>
>>>>> "
>>>>> textShower := GLMMorphicRenderer new.
>>>>> (textShower open: (
>>>>> GLMTextPresentation new display: textRenderer; renderGlamorouslyOn:
>>>>> textShower; yourself )) window title: 'Prolog Editor'.
>>>>> "Here I created a highlighter through the transform method of the
>>>>> grammar"
>>>>> grammar := PPPrologParser new.
>>>>> highlighter := grammar transform: [ :parser |
>>>>> Transcript show: parser.
>>>>> parser class = TokenParser
>>>>> ifTrue: [ parser ==> [ :token |
>>>>> textShower model highlight: token style range: token interval ] ]
>>>>> ifFalse: [ parser ] ].
>>>>> text := 'p(Q,R):-q(R), unify_st(X, smalltalk_code), r(T).
>>>>> q(Q):-d(R).
>>>>> q(Q).'.
>>>>> pp := highlighter parse: text asText.
>>>>
>>>>
>>>>
>>>> However, as I said, it was too much work to create everything from
>>>> scratch, so I decided only to impose queries and the result looks pretty
>>>> much as the code I provided in my previous post.
>>>>
>>>>
>>>> I omitted one detail however; I am using a python bridge through the
>>>> pyswi library which does pretty much was I was trying to achieve with
>>>> NativeBoost. It is a RPC-JSON server which handles the interaction between
>>>> Pharo and Prolog and retrieves the query results in a JSON dictionary.
>>>>
>>>> At about that time I also was looking at Logtalk (logtalk.org) for
>>>>> SWI and maybe waiting for XSB ... as our manager would not go for iLOG and
>>>>> we were VisualWorks only ... then IBM bought iLOG and something odd
>>>>> happened to Prologia with Air Liquide in France.
>>>>
>>>>
>>>> Logtalk is pretty much what I wanted to achieve, but the OOP language
>>>> would be Pharo instead. I still think it would be good to make some effort
>>>> towards creating such a framework, if I can call it like that.
>>>>
>>>> You may know about the prolog for Smalltalk/DOS of about 1990 vintage
>>>>> ... I must have it on a floppy in a box somewhere on a shelf.
>>>>
>>>>
>>>> I would be interesting to have a look. Please send me a copy to this
>>>> email if you find it.
>>>>
>>>> Cheers,
>>>> Jesus
>>>>
>>>>
>>>>
>>>> 2013/9/25 Robert Shiplett <grshiplett(a)gmail.com>
>>>>
>>>>> You may know about the prolog for Smalltalk/DOS of about 1990 vintage
>>>>> ... I must have it on a floppy in a box somewhere on a shelf.
>>>>>
>>>>> R
>>>>>
>>>>>
>>>>> On 25 September 2013 10:29, Jesus Nuñez <poissonbreaker(a)gmail.com>wrote:
>>>>>
>>>>>> I'll try to elaborate but what I can say is only from my limited
>>>>>> perspective. You can take it as an incomplete argument that needs much
>>>>>> refinement, but could however serve as a seed for an upcoming idea.
>>>>>>
>>>>>> Search: After all we can see the entire web as a large graph which we
>>>>>> seek to traverse, looking for information. First-order logic is the most
>>>>>> neutral and natural way of representing the web. With facts and rules that
>>>>>> convolve to derive new conclusions, logic is perhaps the most compact way
>>>>>> of representing pretty much any kind of relationships.
>>>>>>
>>>>>> Think of a model for a situation that would accept a query as below
>>>>>> with some facts and rules governing the dynamics of the underlying world:
>>>>>>
>>>>>> *"Give me all restaurants in the city where someone whose name is
>>>>>> Laura has been a client at least once per month during the last 3 months
>>>>>> and whose has always paid with credit card"*
>>>>>>
>>>>>> My opinions are based on the power of tools in Pharo, such as the
>>>>>> moose family for data visualization and related stuff and of course
>>>>>> Seaside, together with Prolog first order logic syntax, unification,
>>>>>> backtracking capabilities, and search based on a sound resolution method.
>>>>>> In the case of the use of Prolog for the semantic web, see for instance
>>>>>> http://attempto.ifi.uzh.ch/site<http://attempto.ifi.uzh.ch/site/docs/>
>>>>>> .
>>>>>>
>>>>>> Prolog counts also with mature semantic web packages
>>>>>> http://www.swi-prolog.org/web/ that handles the semantic web RDF
>>>>>> model naturally. For instance have a look at
>>>>>> http://www.semanticweb.gr/topos/. In this very application you may
>>>>>> also discover how Pharo can naturally fit in a similar application.
>>>>>>
>>>>>> In a personal attempt (indeed it is part of my master thesis); since
>>>>>> I am in Pharo 1.4, I wanted to emulate the helvetia language boxes, to
>>>>>> create rules in Pharo and interact with Prolog as in the example below for
>>>>>> a SQL language box,
>>>>>>
>>>>>> rows := *SELECT * FROM users WHERE username = @(aString ~=
>>>>>> /\s*(\w+)\s*/)*
>>>>>>
>>>>>> I created a parser in PetitParser for Prolog, however It was too much
>>>>>> work to create something as the above from scratch (also somewhat involved
>>>>>> is to handle operator declaration in Prolog) and finally I end up with a
>>>>>> tool for imposing only queries to Prolog and retrive the results in a JSON
>>>>>> dictionary using SocketStream for RPC handling and NeoJSONReader to read
>>>>>> the JSON contents from the stream.
>>>>>>
>>>>>> Just for reference, it looks as follows,
>>>>>>
>>>>>> Transcript open.
>>>>>> stream := SocketStream openConnectionToHostNamed: 'localhost' port:
>>>>>> 31415.
>>>>>> [
>>>>>> text:='{"method":"query", "params": ["owns_Zebra(O,X)"], "id":0}'.
>>>>>> stream nextPutAll:text; flush.
>>>>>> Transcript cr; show:(stream upToEnd).
>>>>>> ] ensure: [
>>>>>> stream close
>>>>>> ]
>>>>>>
>>>>>> map := (NeoJSONReader on: (result contents) readStream )
>>>>>> next.
>>>>>>
>>>>>> Again, it is only my limited view, and I am only starting to
>>>>>> understand the fundamentals of semantic web but I think it is not a bad
>>>>>> idea to create a productive conjunction of this two wonderful worlds. So
>>>>>> please don't blame on me if I am wrong in all of my thoughs,
>>>>>>
>>>>>> Cheers,
>>>>>> Jesus
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> 2013/9/25 Norbert Hartl <norbert(a)hartl.name>
>>>>>>
>>>>>>>
>>>>>>> Am 25.09.2013 um 13:02 schrieb Jesus Nuñez <poissonbreaker(a)gmail.com
>>>>>>> >:
>>>>>>>
>>>>>>> What did happen to Helvetia? Sorry if I am an ignorant here but I
>>>>>>> think language boxes in Pharo; to interac, remarkably with Prolog, would be
>>>>>>> definitely a plus for semantic web development in Smalltalk.
>>>>>>>
>>>>>>> Cheers
>>>>>>>
>>>>>>> Sounds interesting. Can you elaborate on that? How could all of
>>>>>>> those mentioned support the semantic web? [1]
>>>>>>>
>>>>>>> Norbert
>>>>>>>
>>>>>>> [1] http://en.wikipedia.org/wiki/Semantic_Web
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> 2013/9/25 Norbert Hartl <norbert(a)hartl.name>
>>>>>>>
>>>>>>>> Looking for semantic web tools I found
>>>>>>>>
>>>>>>>> http://www.squeaksource.com/TripleStore/
>>>>>>>>
>>>>>>>> Are there other resources for the semantic web in pharo? smalltalk?
>>>>>>>>
>>>>>>>> Norbert
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>
>>>>>
>>>>
>>>>
>>>
>>
>
Sept. 25, 2013
Re: [Pharo-users] Semantic web packages
by Jesus Nuñez
Sorry, I hate its syntax, too verbose for my taste. What about dynamic
modules, DCG, CHR, CLP, performance in general?. What about
meta-programming, operator declarations. Do you really thing SOUL is a good
replacement for Prolog?, I do not see the expressiveness of Prolog
reflected in what I have seen. What about the libraries I mentioned for
semantic web?
Think now about Prolog and the Helvetia approach, don't you thing it would
be much more attractive for newcommers or people who already knows Prolog?
If you put both approaches over the table I woudn't hesitate in taking the
Helvetia approach.
Cheers,
Jesus
2013/9/25 Jesus Nuñez <poissonbreaker(a)gmail.com>
> OK I found it, I'll have a look
>
>
> 2013/9/25 Jesus Nuñez <poissonbreaker(a)gmail.com>
>
>> where is it??
>>
>>
>> 2013/9/25 Stéphane Ducasse <stephane.ducasse(a)inria.fr>
>>
>>> did you look at SOUL?
>>>
>>> Stef
>>>
>>> On Sep 25, 2013, at 9:15 PM, Jesus Nuñez <poissonbreaker(a)gmail.com>
>>> wrote:
>>>
>>> In my very first attempt, I tried to port a package which sounds to me
>>> like the one you describe. In the examples there was a snoopy world as a
>>> search example, maybe you recall it from that. However I realized that I
>>> didn't want to emulate Prolog in Pharo; nothing like fast compiled and
>>> optimized code for WAM.
>>>
>>> The idea was to emulate the language boxes of Helvetia to mix Prolog and
>>> Smalltalk code and use NativeBoost to call the swi-prolog shared library,
>>> so I could use a highly deployed version of Prolog. Some time ago I made
>>> an inquiry and for handling some text highlighting issues that would help
>>> in my aims, just for a direct reference, the code is below:
>>>
>>> | text textRenderer textShower |
>>>> text := 'p(Q,R):-q(R), unify_st(X, smalltalk_code), r(T).
>>>> q(Q):-d(R).
>>>> q(Q).'.
>>>> textRenderer := [
>>>> PPTextHighlighter new
>>>> parser: PPPrologParser new;
>>>> color: 'small_atom' with: Color blue muchDarker;
>>>> bold: 'small_atom';
>>>> color: 'unify_st' with: Color green muchDarker;
>>>> bold: 'unify_st';
>>>> color: 'string' with: Color gray muchDarker;
>>>> color: 'number' with: Color gray muchDarker;
>>>> color: 'boolean' with: Color gray muchDarker;
>>>> highlight: text asText.
>>>> ].
>>>> " __
>>>> |
>>>> <Renders IN>
>>>> |
>>>> W
>>>> GLMTextPresentation
>>>> |
>>>> <Renders IN>
>>>> |
>>>> W
>>>> GLMMorphicRenderer
>>>>
>>>> "
>>>> textShower := GLMMorphicRenderer new.
>>>> (textShower open: (
>>>> GLMTextPresentation new display: textRenderer; renderGlamorouslyOn:
>>>> textShower; yourself )) window title: 'Prolog Editor'.
>>>> "Here I created a highlighter through the transform method of the
>>>> grammar"
>>>> grammar := PPPrologParser new.
>>>> highlighter := grammar transform: [ :parser |
>>>> Transcript show: parser.
>>>> parser class = TokenParser
>>>> ifTrue: [ parser ==> [ :token |
>>>> textShower model highlight: token style range: token interval ] ]
>>>> ifFalse: [ parser ] ].
>>>> text := 'p(Q,R):-q(R), unify_st(X, smalltalk_code), r(T).
>>>> q(Q):-d(R).
>>>> q(Q).'.
>>>> pp := highlighter parse: text asText.
>>>
>>>
>>>
>>> However, as I said, it was too much work to create everything from
>>> scratch, so I decided only to impose queries and the result looks pretty
>>> much as the code I provided in my previous post.
>>>
>>>
>>> I omitted one detail however; I am using a python bridge through the
>>> pyswi library which does pretty much was I was trying to achieve with
>>> NativeBoost. It is a RPC-JSON server which handles the interaction between
>>> Pharo and Prolog and retrieves the query results in a JSON dictionary.
>>>
>>> At about that time I also was looking at Logtalk (logtalk.org) for SWI
>>>> and maybe waiting for XSB ... as our manager would not go for iLOG and we
>>>> were VisualWorks only ... then IBM bought iLOG and something odd happened
>>>> to Prologia with Air Liquide in France.
>>>
>>>
>>> Logtalk is pretty much what I wanted to achieve, but the OOP language
>>> would be Pharo instead. I still think it would be good to make some effort
>>> towards creating such a framework, if I can call it like that.
>>>
>>> You may know about the prolog for Smalltalk/DOS of about 1990 vintage
>>>> ... I must have it on a floppy in a box somewhere on a shelf.
>>>
>>>
>>> I would be interesting to have a look. Please send me a copy to this
>>> email if you find it.
>>>
>>> Cheers,
>>> Jesus
>>>
>>>
>>>
>>> 2013/9/25 Robert Shiplett <grshiplett(a)gmail.com>
>>>
>>>> You may know about the prolog for Smalltalk/DOS of about 1990 vintage
>>>> ... I must have it on a floppy in a box somewhere on a shelf.
>>>>
>>>> R
>>>>
>>>>
>>>> On 25 September 2013 10:29, Jesus Nuñez <poissonbreaker(a)gmail.com>wrote:
>>>>
>>>>> I'll try to elaborate but what I can say is only from my limited
>>>>> perspective. You can take it as an incomplete argument that needs much
>>>>> refinement, but could however serve as a seed for an upcoming idea.
>>>>>
>>>>> Search: After all we can see the entire web as a large graph which we
>>>>> seek to traverse, looking for information. First-order logic is the most
>>>>> neutral and natural way of representing the web. With facts and rules that
>>>>> convolve to derive new conclusions, logic is perhaps the most compact way
>>>>> of representing pretty much any kind of relationships.
>>>>>
>>>>> Think of a model for a situation that would accept a query as below
>>>>> with some facts and rules governing the dynamics of the underlying world:
>>>>>
>>>>> *"Give me all restaurants in the city where someone whose name is
>>>>> Laura has been a client at least once per month during the last 3 months
>>>>> and whose has always paid with credit card"*
>>>>>
>>>>> My opinions are based on the power of tools in Pharo, such as the
>>>>> moose family for data visualization and related stuff and of course
>>>>> Seaside, together with Prolog first order logic syntax, unification,
>>>>> backtracking capabilities, and search based on a sound resolution method.
>>>>> In the case of the use of Prolog for the semantic web, see for instance
>>>>> http://attempto.ifi.uzh.ch/site<http://attempto.ifi.uzh.ch/site/docs/>
>>>>> .
>>>>>
>>>>> Prolog counts also with mature semantic web packages
>>>>> http://www.swi-prolog.org/web/ that handles the semantic web RDF
>>>>> model naturally. For instance have a look at
>>>>> http://www.semanticweb.gr/topos/. In this very application you may
>>>>> also discover how Pharo can naturally fit in a similar application.
>>>>>
>>>>> In a personal attempt (indeed it is part of my master thesis); since I
>>>>> am in Pharo 1.4, I wanted to emulate the helvetia language boxes, to create
>>>>> rules in Pharo and interact with Prolog as in the example below for a SQL
>>>>> language box,
>>>>>
>>>>> rows := *SELECT * FROM users WHERE username = @(aString ~=
>>>>> /\s*(\w+)\s*/)*
>>>>>
>>>>> I created a parser in PetitParser for Prolog, however It was too much
>>>>> work to create something as the above from scratch (also somewhat involved
>>>>> is to handle operator declaration in Prolog) and finally I end up with a
>>>>> tool for imposing only queries to Prolog and retrive the results in a JSON
>>>>> dictionary using SocketStream for RPC handling and NeoJSONReader to read
>>>>> the JSON contents from the stream.
>>>>>
>>>>> Just for reference, it looks as follows,
>>>>>
>>>>> Transcript open.
>>>>> stream := SocketStream openConnectionToHostNamed: 'localhost' port:
>>>>> 31415.
>>>>> [
>>>>> text:='{"method":"query", "params": ["owns_Zebra(O,X)"], "id":0}'.
>>>>> stream nextPutAll:text; flush.
>>>>> Transcript cr; show:(stream upToEnd).
>>>>> ] ensure: [
>>>>> stream close
>>>>> ]
>>>>>
>>>>> map := (NeoJSONReader on: (result contents) readStream )
>>>>> next.
>>>>>
>>>>> Again, it is only my limited view, and I am only starting to
>>>>> understand the fundamentals of semantic web but I think it is not a bad
>>>>> idea to create a productive conjunction of this two wonderful worlds. So
>>>>> please don't blame on me if I am wrong in all of my thoughs,
>>>>>
>>>>> Cheers,
>>>>> Jesus
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> 2013/9/25 Norbert Hartl <norbert(a)hartl.name>
>>>>>
>>>>>>
>>>>>> Am 25.09.2013 um 13:02 schrieb Jesus Nuñez <poissonbreaker(a)gmail.com
>>>>>> >:
>>>>>>
>>>>>> What did happen to Helvetia? Sorry if I am an ignorant here but I
>>>>>> think language boxes in Pharo; to interac, remarkably with Prolog, would be
>>>>>> definitely a plus for semantic web development in Smalltalk.
>>>>>>
>>>>>> Cheers
>>>>>>
>>>>>> Sounds interesting. Can you elaborate on that? How could all of those
>>>>>> mentioned support the semantic web? [1]
>>>>>>
>>>>>> Norbert
>>>>>>
>>>>>> [1] http://en.wikipedia.org/wiki/Semantic_Web
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> 2013/9/25 Norbert Hartl <norbert(a)hartl.name>
>>>>>>
>>>>>>> Looking for semantic web tools I found
>>>>>>>
>>>>>>> http://www.squeaksource.com/TripleStore/
>>>>>>>
>>>>>>> Are there other resources for the semantic web in pharo? smalltalk?
>>>>>>>
>>>>>>> Norbert
>>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>
>>>
>>>
>>
>
Sept. 25, 2013
Re: [Pharo-users] Semantic web packages
by Jesus Nuñez
OK I found it, I'll have a look
2013/9/25 Jesus Nuñez <poissonbreaker(a)gmail.com>
> where is it??
>
>
> 2013/9/25 Stéphane Ducasse <stephane.ducasse(a)inria.fr>
>
>> did you look at SOUL?
>>
>> Stef
>>
>> On Sep 25, 2013, at 9:15 PM, Jesus Nuñez <poissonbreaker(a)gmail.com>
>> wrote:
>>
>> In my very first attempt, I tried to port a package which sounds to me
>> like the one you describe. In the examples there was a snoopy world as a
>> search example, maybe you recall it from that. However I realized that I
>> didn't want to emulate Prolog in Pharo; nothing like fast compiled and
>> optimized code for WAM.
>>
>> The idea was to emulate the language boxes of Helvetia to mix Prolog and
>> Smalltalk code and use NativeBoost to call the swi-prolog shared library,
>> so I could use a highly deployed version of Prolog. Some time ago I made
>> an inquiry and for handling some text highlighting issues that would help
>> in my aims, just for a direct reference, the code is below:
>>
>> | text textRenderer textShower |
>>> text := 'p(Q,R):-q(R), unify_st(X, smalltalk_code), r(T).
>>> q(Q):-d(R).
>>> q(Q).'.
>>> textRenderer := [
>>> PPTextHighlighter new
>>> parser: PPPrologParser new;
>>> color: 'small_atom' with: Color blue muchDarker;
>>> bold: 'small_atom';
>>> color: 'unify_st' with: Color green muchDarker;
>>> bold: 'unify_st';
>>> color: 'string' with: Color gray muchDarker;
>>> color: 'number' with: Color gray muchDarker;
>>> color: 'boolean' with: Color gray muchDarker;
>>> highlight: text asText.
>>> ].
>>> " __
>>> |
>>> <Renders IN>
>>> |
>>> W
>>> GLMTextPresentation
>>> |
>>> <Renders IN>
>>> |
>>> W
>>> GLMMorphicRenderer
>>>
>>> "
>>> textShower := GLMMorphicRenderer new.
>>> (textShower open: (
>>> GLMTextPresentation new display: textRenderer; renderGlamorouslyOn:
>>> textShower; yourself )) window title: 'Prolog Editor'.
>>> "Here I created a highlighter through the transform method of the
>>> grammar"
>>> grammar := PPPrologParser new.
>>> highlighter := grammar transform: [ :parser |
>>> Transcript show: parser.
>>> parser class = TokenParser
>>> ifTrue: [ parser ==> [ :token |
>>> textShower model highlight: token style range: token interval ] ]
>>> ifFalse: [ parser ] ].
>>> text := 'p(Q,R):-q(R), unify_st(X, smalltalk_code), r(T).
>>> q(Q):-d(R).
>>> q(Q).'.
>>> pp := highlighter parse: text asText.
>>
>>
>>
>> However, as I said, it was too much work to create everything from
>> scratch, so I decided only to impose queries and the result looks pretty
>> much as the code I provided in my previous post.
>>
>>
>> I omitted one detail however; I am using a python bridge through the
>> pyswi library which does pretty much was I was trying to achieve with
>> NativeBoost. It is a RPC-JSON server which handles the interaction between
>> Pharo and Prolog and retrieves the query results in a JSON dictionary.
>>
>> At about that time I also was looking at Logtalk (logtalk.org) for SWI
>>> and maybe waiting for XSB ... as our manager would not go for iLOG and we
>>> were VisualWorks only ... then IBM bought iLOG and something odd happened
>>> to Prologia with Air Liquide in France.
>>
>>
>> Logtalk is pretty much what I wanted to achieve, but the OOP language
>> would be Pharo instead. I still think it would be good to make some effort
>> towards creating such a framework, if I can call it like that.
>>
>> You may know about the prolog for Smalltalk/DOS of about 1990 vintage
>>> ... I must have it on a floppy in a box somewhere on a shelf.
>>
>>
>> I would be interesting to have a look. Please send me a copy to this
>> email if you find it.
>>
>> Cheers,
>> Jesus
>>
>>
>>
>> 2013/9/25 Robert Shiplett <grshiplett(a)gmail.com>
>>
>>> You may know about the prolog for Smalltalk/DOS of about 1990 vintage
>>> ... I must have it on a floppy in a box somewhere on a shelf.
>>>
>>> R
>>>
>>>
>>> On 25 September 2013 10:29, Jesus Nuñez <poissonbreaker(a)gmail.com>wrote:
>>>
>>>> I'll try to elaborate but what I can say is only from my limited
>>>> perspective. You can take it as an incomplete argument that needs much
>>>> refinement, but could however serve as a seed for an upcoming idea.
>>>>
>>>> Search: After all we can see the entire web as a large graph which we
>>>> seek to traverse, looking for information. First-order logic is the most
>>>> neutral and natural way of representing the web. With facts and rules that
>>>> convolve to derive new conclusions, logic is perhaps the most compact way
>>>> of representing pretty much any kind of relationships.
>>>>
>>>> Think of a model for a situation that would accept a query as below
>>>> with some facts and rules governing the dynamics of the underlying world:
>>>>
>>>> *"Give me all restaurants in the city where someone whose name is
>>>> Laura has been a client at least once per month during the last 3 months
>>>> and whose has always paid with credit card"*
>>>>
>>>> My opinions are based on the power of tools in Pharo, such as the moose
>>>> family for data visualization and related stuff and of course Seaside,
>>>> together with Prolog first order logic syntax, unification, backtracking
>>>> capabilities, and search based on a sound resolution method. In the case of
>>>> the use of Prolog for the semantic web, see for instance
>>>> http://attempto.ifi.uzh.ch/site <http://attempto.ifi.uzh.ch/site/docs/>
>>>> .
>>>>
>>>> Prolog counts also with mature semantic web packages
>>>> http://www.swi-prolog.org/web/ that handles the semantic web RDF model
>>>> naturally. For instance have a look at http://www.semanticweb.gr/topos/.
>>>> In this very application you may also discover how Pharo can naturally fit
>>>> in a similar application.
>>>>
>>>> In a personal attempt (indeed it is part of my master thesis); since I
>>>> am in Pharo 1.4, I wanted to emulate the helvetia language boxes, to create
>>>> rules in Pharo and interact with Prolog as in the example below for a SQL
>>>> language box,
>>>>
>>>> rows := *SELECT * FROM users WHERE username = @(aString ~=
>>>> /\s*(\w+)\s*/)*
>>>>
>>>> I created a parser in PetitParser for Prolog, however It was too much
>>>> work to create something as the above from scratch (also somewhat involved
>>>> is to handle operator declaration in Prolog) and finally I end up with a
>>>> tool for imposing only queries to Prolog and retrive the results in a JSON
>>>> dictionary using SocketStream for RPC handling and NeoJSONReader to read
>>>> the JSON contents from the stream.
>>>>
>>>> Just for reference, it looks as follows,
>>>>
>>>> Transcript open.
>>>> stream := SocketStream openConnectionToHostNamed: 'localhost' port:
>>>> 31415.
>>>> [
>>>> text:='{"method":"query", "params": ["owns_Zebra(O,X)"], "id":0}'.
>>>> stream nextPutAll:text; flush.
>>>> Transcript cr; show:(stream upToEnd).
>>>> ] ensure: [
>>>> stream close
>>>> ]
>>>>
>>>> map := (NeoJSONReader on: (result contents) readStream )
>>>> next.
>>>>
>>>> Again, it is only my limited view, and I am only starting to understand
>>>> the fundamentals of semantic web but I think it is not a bad idea to create
>>>> a productive conjunction of this two wonderful worlds. So please don't
>>>> blame on me if I am wrong in all of my thoughs,
>>>>
>>>> Cheers,
>>>> Jesus
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>> 2013/9/25 Norbert Hartl <norbert(a)hartl.name>
>>>>
>>>>>
>>>>> Am 25.09.2013 um 13:02 schrieb Jesus Nuñez <poissonbreaker(a)gmail.com>:
>>>>>
>>>>> What did happen to Helvetia? Sorry if I am an ignorant here but I
>>>>> think language boxes in Pharo; to interac, remarkably with Prolog, would be
>>>>> definitely a plus for semantic web development in Smalltalk.
>>>>>
>>>>> Cheers
>>>>>
>>>>> Sounds interesting. Can you elaborate on that? How could all of those
>>>>> mentioned support the semantic web? [1]
>>>>>
>>>>> Norbert
>>>>>
>>>>> [1] http://en.wikipedia.org/wiki/Semantic_Web
>>>>>
>>>>>
>>>>>
>>>>>
>>>>> 2013/9/25 Norbert Hartl <norbert(a)hartl.name>
>>>>>
>>>>>> Looking for semantic web tools I found
>>>>>>
>>>>>> http://www.squeaksource.com/TripleStore/
>>>>>>
>>>>>> Are there other resources for the semantic web in pharo? smalltalk?
>>>>>>
>>>>>> Norbert
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>
>>>
>>
>>
>
Sept. 25, 2013