Pharo-dev
By thread
pharo-dev@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
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
March 2014
- 63 participants
- 1299 messages
Re: [Pharo-dev] [Moose-dev] [Pharo-business] [ANN] DBPedia: Query Wikipedia from Pharo
by Pharo4Stef
Alexandre
so cool
Noa may be taking the idea of ROE (to manipulate queries) and creating a ROE for SPARQL should be investigated.
Is your student good.
I do not remember how roe is implemented.
Stef\
On 03 Mar 2014, at 01:22, Alexandre Bergel <alexandre.bergel(a)me.com> wrote:
> Iâve just tried and it works pretty well! Impressive!
>
> Below I describe a small example that fetches some data about the US Universities from DBPedia and visualize them using Roassal2.
>
> Pick a fresh 3.0 image.
>
> First, you need to load Hernán work, Svenâs NeoJSON, and Roassal 2 (If you are using a Moose Image, there is no need to load Roassal2 since it is already in):
> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
> Gofer it
> smalltalkhubUser: 'SvenVanCaekenberghe' project: 'Neo';
> package: 'ConfigurationOfNeoJSON';
> load.
> ((Smalltalk at: #ConfigurationOfNeoJSON) load).
>
> Gofer it
> smalltalkhubUser: 'hernan' project: 'DBPedia';
> package: 'DBPedia';
> load.
>
> Gofer it
> smalltalkhubUser: 'ObjectProfile' project: 'Roassal2';
> package: 'ConfigurationOfRoassal2';
> load.
> ((Smalltalk at: #ConfigurationOfRoassal2) loadBleedingEdge).
>
> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
>
> Using Roassal2, I was able to render some data extracted from dbpedia:
>
> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
> | map locations rawData rawData2 rawData3 |
> map := RTMapBuilder new.
>
> map countries: #('UnitedStates' 'Canada' 'Mexico').
> map color: Color veryVeryLightGray.
>
> rawData := DBPediaSearch universitiesInUS.
> rawData2 := ((NeoJSONReader fromString: rawData) at: #results) at: #bindings.
> rawData3 := rawData2 select: [ :d | d keys includesAll: #('label' 'long' 'lat') ] thenCollect: [ :d | { (Float readFrom: ((d at: 'long') at: 'value')) . (Float readFrom: ((d at: 'lat') at: 'value')) . (d at: 'label' ) at: 'value' } ].
>
>
> locations := rawData3.
> locations do: [ :array |
> map cities addCityNamed: array third location: array second @ array first ].
> map cities shape size: 8; color: (Color blue alpha: 0.03).
> map cities: (locations collect: #third).
>
> map scale: 2.
>
> map render.
> map view openInWindowSized: 1000 @ 500.
> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
>
> This is what you get:
>
> <Screen Shot 2014-03-02 at 9.09.57 PM.png>
>
> This is a small example. Naturally, adding popup for locations is trivial to add.
>
> I have described this on our Facebook page:
> https://www.facebook.com/ObjectProfile/photos/a.341189379300999.82969.34054…
>
> Hernán, since SPARQL is a bit obscure, it would be great if you could add some more example, and also, how to parametrize the examples. For example, now we can get data for the US, how to modify your example to get them for France or Chile?
>
> Cheers,
> Alexandre
>
>
> On Mar 2, 2014, at 3:43 PM, Hernán Morales Durand <hernan.morales(a)gmail.com> wrote:
>
>> I have uploaded a new configuration so you can query the english Wikipedia dataset from Pharo 3 using SPARQL. Some examples follow:
>>
>> 1) Retrieve in JSON movies from the beautiful Julianne Moore:
>>
>> | jsonResults |
>> jsonResults := DBPediaSearch new
>> setJsonFormat;
>> timeout: 5000;
>> query: 'SELECT DISTINCT ?filmName WHERE {
>> ?film foaf:name ?filmName .
>> ?film dbpedia-owl:starring ?actress .
>> ?actress foaf:name ?name.
>> FILTER(contains(?name, "Julianne"))
>> FILTER(contains(?name, "Moore"))
>> }';
>> execute
>>
>> To actually get only the titles using NeoJSON:
>>
>> ((((NeoJSONReader fromString: jsonResults) at: #results) at: #bindings)
>> collect: [ : entry | entry at: #filmName ]) collect: [ : movie | movie at: #value ]
>>
>>
>> 2) Retrieve in XML which genre plays those crazy Dream Theater guys :
>>
>> DBPediaSearch new
>> setXmlFormat;
>> setDebugOn;
>> timeout: 5000;
>> query: 'SELECT DISTINCT ?genreLabel
>> WHERE {
>> ?resource dbpprop:genre ?genre.
>> ?resource rdfs:label "Dream Theater"@en.
>> ?genre rdfs:label ?genreLabel
>> FILTER (lang(?genreLabel)="en")
>> }
>> LIMIT 100';
>> execute
>>
>> More examples are available in DBPediaSearch class side. You can install it from the Configuration Browser.
>> If you want to contribute, just ask me and you will be added as contributor.
>> Best regards,
>>
>> Hernán
>>
>> _______________________________________________
>> Pharo-business mailing list
>> Pharo-business(a)lists.pharo.org
>> http://lists.pharo.org/mailman/listinfo/pharo-business_lists.pharo.org
>
> --
> _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
> Alexandre Bergel http://www.bergel.eu
> ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
>
>
>
> _______________________________________________
> Moose-dev mailing list
> Moose-dev(a)iam.unibe.ch
> https://www.iam.unibe.ch/mailman/listinfo/moose-dev
March 3, 2014
Re: [Pharo-dev] [Moose-dev] [Pharo-business] [ANN] DBPedia: Query Wikipedia from Pharo
by Tudor Girba
+1
Doru
On Mon, Mar 3, 2014 at 7:30 AM, Pharo4Stef <pharo4Stef(a)free.fr> wrote:
> What would be nice is to have an abstraction like mongoTalk on top to
> avoid to manipulate strings but to manipulate query elements.
>
> Stef
>
>
>
>
>
> 2014-03-02 21:22 GMT-03:00 Alexandre Bergel <alexandre.bergel(a)me.com>:
>
>> I've just tried and it works pretty well! Impressive!
>>
>> Below I describe a small example that fetches some data about the US
>> Universities from DBPedia and visualize them using Roassal2.
>>
>> Pick a fresh 3.0 image.
>>
>> First, you need to load Hernán work, Sven's NeoJSON, and Roassal 2 (If
>> you are using a Moose Image, there is no need to load Roassal2 since it is
>> already in):
>> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
>> Gofer it
>> smalltalkhubUser: 'SvenVanCaekenberghe' project: 'Neo';
>> package: 'ConfigurationOfNeoJSON';
>> load.
>> ((Smalltalk at: #ConfigurationOfNeoJSON) load).
>>
>> Gofer it
>> smalltalkhubUser: 'hernan' project: 'DBPedia';
>> package: 'DBPedia';
>> load.
>>
>> Gofer it
>> smalltalkhubUser: 'ObjectProfile' project: 'Roassal2';
>> package: 'ConfigurationOfRoassal2';
>> load.
>> ((Smalltalk at: #ConfigurationOfRoassal2) loadBleedingEdge).
>>
>> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
>>
>> Using Roassal2, I was able to render some data extracted from dbpedia:
>>
>> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
>> | map locations rawData rawData2 rawData3 |
>> map := RTMapBuilder new.
>>
>> map countries: #('UnitedStates' 'Canada' 'Mexico').
>> map color: Color veryVeryLightGray.
>>
>> rawData := DBPediaSearch universitiesInUS.
>> rawData2 := ((NeoJSONReader fromString: rawData) at: #results) at:
>> #bindings.
>> rawData3 := rawData2 select: [ :d | d keys includesAll: #('label' 'long'
>> 'lat') ] thenCollect: [ :d | { (Float readFrom: ((d at: 'long') at:
>> 'value')) . (Float readFrom: ((d at: 'lat') at: 'value')) . (d at: 'label'
>> ) at: 'value' } ].
>>
>>
>> locations := rawData3.
>> locations do: [ :array |
>> map cities addCityNamed: array third location: array second @ array first
>> ].
>> map cities shape size: 8; color: (Color blue alpha: 0.03).
>> map cities: (locations collect: #third).
>>
>> map scale: 2.
>>
>> map render.
>> map view openInWindowSized: 1000 @ 500.
>> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
>>
>> This is what you get:
>>
>> <Screen Shot 2014-03-02 at 9.09.57 PM.png>
>>
>> This is a small example. Naturally, adding popup for locations is trivial
>> to add.
>>
>> I have described this on our Facebook page:
>>
>> https://www.facebook.com/ObjectProfile/photos/a.341189379300999.82969.34054…
>>
>>
> Super cool!! Thanks for sharing the nice mapping.
>
> Hernán, since SPARQL is a bit obscure,
>>
>
> Absolutely, SPARQL is like the Assembler of the web.
>
>
>> it would be great if you could add some more example, and also, how to
>> parametrize the examples. For example, now we can get data for the US, how
>> to modify your example to get them for France or Chile?
>>
>>
> Ok, uploaded an updated version. I have parametrized the query triplets as
> #universitiesIn: englishCountryName,
>
> DBPediaSearch universitiesIn: 'France'.
> DBPediaSearch universitiesIn: 'Chile'.
>
> I have to admit I am still learning SPARQL, but the more queries I
> execute, the more I discover linked data structure, so I will add
> convenience methods for easy parsing results.
>
> Cheers,
>
> Hernán
>
>
>
> _______________________________________________
> Moose-dev mailing list
> Moose-dev(a)iam.unibe.ch
> https://www.iam.unibe.ch/mailman/listinfo/moose-dev
>
>
>
--
www.tudorgirba.com
"Every thing has its own flow"
March 3, 2014
Re: [Pharo-dev] [Pharo-business] [ANN] DBPedia: Query Wikipedia from Pharo
by Tudor Girba
Excellent, Alex!
That is exactly what we need to do for Moose and Roassal. Are you using the
GTInspector for developing this? :)
Doru
On Mon, Mar 3, 2014 at 1:33 AM, Alexandre Bergel <alexandre.bergel(a)me.com>wrote:
> A followup from the previous post. Fetching country population and
> charting them using GraphET:
>
> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
> | query data diagram |
>
> query := DBPediaSearch new
> setJsonFormat;
> setDebugOn;
> timeout: 3000;
> query: 'SELECT DISTINCT ?name ?population
> WHERE {
> ?country a dbpedia-owl:Country .
> ?country rdfs:label ?name .
> FILTER
> (langMatches(lang(?name), "en"))
> values ?hasPopulation { dbpprop:populationEstimatedbpprop:populationCensus
> }
> OPTIONAL { ?country ?hasPopulation ?population }
> FILTER (isNumeric(?population))
> FILTER NOT EXISTS { ?country dbpedia-owl:dissolutionYear ?yearEnd } {
> ?country dbpprop:iso3166code ?code . }
> UNION { ?country dbpprop:iso31661Alpha ?code . }
> UNION { ?country dbpprop:countryCode ?code . }
> UNION { ?country a yago:MemberStatesOfTheUnitedNations . }}';
> execute.
>
> data := (((NeoJSONReader fromString: query) at:#results) at: #bindings)
> collect: [ :entry | Array with: ( (entry at: #name) at: #value ) with: (
> (entry at: #population) at: #value ) asInteger ].
>
> "Use GraphET to render all this"
> diagram := GETDiagramBuilder new.
> diagram verticalBarDiagram
> models: (data reverseSortedAs: #second);
> y: #second;
> regularAxisAsInteger;
> titleLabel: 'Size of countries';
> yAxisLabel: 'Population'.
> diagram interaction popupText.
>
> diagram open
> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
>
>
> Cheers,
> Alexandre
>
>
> On Mar 2, 2014, at 9:22 PM, Alexandre Bergel <alexandre.bergel(a)me.com>
> wrote:
>
> I've just tried and it works pretty well! Impressive!
>
> Below I describe a small example that fetches some data about the US
> Universities from DBPedia and visualize them using Roassal2.
>
> Pick a fresh 3.0 image.
>
> First, you need to load Hernán work, Sven's NeoJSON, and Roassal 2 (If you
> are using a Moose Image, there is no need to load Roassal2 since it is
> already in):
> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
> Gofer it
> smalltalkhubUser: 'SvenVanCaekenberghe' project: 'Neo';
> package: 'ConfigurationOfNeoJSON';
> load.
> ((Smalltalk at: #ConfigurationOfNeoJSON) load).
>
> Gofer it
> smalltalkhubUser: 'hernan' project: 'DBPedia';
> package: 'DBPedia';
> load.
>
> Gofer it
> smalltalkhubUser: 'ObjectProfile' project: 'Roassal2';
> package: 'ConfigurationOfRoassal2';
> load.
> ((Smalltalk at: #ConfigurationOfRoassal2) loadBleedingEdge).
>
> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
>
> Using Roassal2, I was able to render some data extracted from dbpedia:
>
> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
> | map locations rawData rawData2 rawData3 |
> map := RTMapBuilder new.
>
> map countries: #('UnitedStates' 'Canada' 'Mexico').
> map color: Color veryVeryLightGray.
>
> rawData := DBPediaSearch universitiesInUS.
> rawData2 := ((NeoJSONReader fromString: rawData) at: #results) at:
> #bindings.
> rawData3 := rawData2 select: [ :d | d keys includesAll: #('label' 'long'
> 'lat') ] thenCollect: [ :d | { (Float readFrom: ((d at: 'long') at:
> 'value')) . (Float readFrom: ((d at: 'lat') at: 'value')) . (d at: 'label'
> ) at: 'value' } ].
>
>
> locations := rawData3.
> locations do: [ :array |
> map cities addCityNamed: array third location: array second @ array first
> ].
> map cities shape size: 8; color: (Color blue alpha: 0.03).
> map cities: (locations collect: #third).
>
> map scale: 2.
>
> map render.
> map view openInWindowSized: 1000 @ 500.
> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
>
> This is what you get:
>
> <Screen Shot 2014-03-02 at 9.09.57 PM.png>
>
>
> This is a small example. Naturally, adding popup for locations is trivial
> to add.
>
> I have described this on our Facebook page:
>
> https://www.facebook.com/ObjectProfile/photos/a.341189379300999.82969.34054…
> type=1&theater
>
> Hernán, since SPARQL is a bit obscure, it would be great if you could add
> some more example, and also, how to parametrize the examples. For example,
> now we can get data for the US, how to modify your example to get them
> for France or Chile?
>
> Cheers,
> Alexandre
>
>
> On Mar 2, 2014, at 3:43 PM, Hernán Morales Durand <
> hernan.morales(a)gmail.com> wrote:
>
> I have uploaded a new configuration so you can query the english Wikipedia
> dataset from Pharo 3 using SPARQL. Some examples follow:
>
> 1) Retrieve in JSON movies from the beautiful Julianne Moore:
>
> | jsonResults |
> jsonResults := DBPediaSearch new
> setJsonFormat;
> timeout: 5000;
> query: 'SELECT DISTINCT ?filmName WHERE {
> ?film foaf:name ?filmName .
> ?film dbpedia-owl:starring ?actress .
> ?actress foaf:name ?name.
> FILTER(contains(?name, "Julianne"))
> FILTER(contains(?name, "Moore"))
> }';
> execute
>
> To actually get only the titles using NeoJSON:
>
> ((((NeoJSONReader fromString: jsonResults) at: #results) at: #bindings)
> collect: [ : entry | entry at: #filmName ]) collect: [ : movie | movie
> at: #value ]
>
>
> 2) Retrieve in XML which genre plays those crazy Dream Theater guys :
>
> DBPediaSearch new
> setXmlFormat;
> setDebugOn;
> timeout: 5000;
> query: 'SELECT DISTINCT ?genreLabel
> WHERE {
> ?resource dbpprop:genre ?genre.
> ?resource rdfs:label "Dream Theater"@en.
> ?genre rdfs:label ?genreLabel
> FILTER (lang(?genreLabel)="en")
> }
> LIMIT 100';
> execute
>
> More examples are available in DBPediaSearch class side. You can install
> it from the Configuration Browser.
> If you want to contribute, just ask me and you will be added as
> contributor.
> Best regards,
>
> Hernán
>
> _______________________________________________
> Pharo-business mailing list
> Pharo-business(a)lists.pharo.org
> http://lists.pharo.org/mailman/listinfo/pharo-business_lists.pharo.org
>
>
> --
> _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
> Alexandre Bergel http://www.bergel.eu
> ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
>
>
>
>
> --
> _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
> Alexandre Bergel http://www.bergel.eu
> ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
>
>
>
>
--
www.tudorgirba.com
"Every thing has its own flow"
March 3, 2014
Re: [Pharo-dev] [Moose-dev] [Pharo-business] [ANN] DBPedia: Query Wikipedia from Pharo
by Pharo4Stef
What would be nice is to have an abstraction like mongoTalk on top to avoid to manipulate strings but to manipulate query elements.
Stef
>
>
>
> 2014-03-02 21:22 GMT-03:00 Alexandre Bergel <alexandre.bergel(a)me.com>:
> Iâve just tried and it works pretty well! Impressive!
>
> Below I describe a small example that fetches some data about the US Universities from DBPedia and visualize them using Roassal2.
>
> Pick a fresh 3.0 image.
>
> First, you need to load Hernán work, Svenâs NeoJSON, and Roassal 2 (If you are using a Moose Image, there is no need to load Roassal2 since it is already in):
> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
> Gofer it
> smalltalkhubUser: 'SvenVanCaekenberghe' project: 'Neo';
> package: 'ConfigurationOfNeoJSON';
> load.
> ((Smalltalk at: #ConfigurationOfNeoJSON) load).
>
> Gofer it
> smalltalkhubUser: 'hernan' project: 'DBPedia';
> package: 'DBPedia';
> load.
>
> Gofer it
> smalltalkhubUser: 'ObjectProfile' project: 'Roassal2';
> package: 'ConfigurationOfRoassal2';
> load.
> ((Smalltalk at: #ConfigurationOfRoassal2) loadBleedingEdge).
>
> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
>
> Using Roassal2, I was able to render some data extracted from dbpedia:
>
> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
> | map locations rawData rawData2 rawData3 |
> map := RTMapBuilder new.
>
> map countries: #('UnitedStates' 'Canada' 'Mexico').
> map color: Color veryVeryLightGray.
>
> rawData := DBPediaSearch universitiesInUS.
> rawData2 := ((NeoJSONReader fromString: rawData) at: #results) at: #bindings.
> rawData3 := rawData2 select: [ :d | d keys includesAll: #('label' 'long' 'lat') ] thenCollect: [ :d | { (Float readFrom: ((d at: 'long') at: 'value')) . (Float readFrom: ((d at: 'lat') at: 'value')) . (d at: 'label' ) at: 'value' } ].
>
>
> locations := rawData3.
> locations do: [ :array |
> map cities addCityNamed: array third location: array second @ array first ].
> map cities shape size: 8; color: (Color blue alpha: 0.03).
> map cities: (locations collect: #third).
>
> map scale: 2.
>
> map render.
> map view openInWindowSized: 1000 @ 500.
> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
>
> This is what you get:
>
> <Screen Shot 2014-03-02 at 9.09.57 PM.png>
>
> This is a small example. Naturally, adding popup for locations is trivial to add.
>
> I have described this on our Facebook page:
> https://www.facebook.com/ObjectProfile/photos/a.341189379300999.82969.34054…
>
>
> Super cool!! Thanks for sharing the nice mapping.
>
> Hernán, since SPARQL is a bit obscure,
>
> Absolutely, SPARQL is like the Assembler of the web.
>
> it would be great if you could add some more example, and also, how to parametrize the examples. For example, now we can get data for the US, how to modify your example to get them for France or Chile?
>
>
> Ok, uploaded an updated version. I have parametrized the query triplets as #universitiesIn: englishCountryName,
>
> DBPediaSearch universitiesIn: 'France'.
> DBPediaSearch universitiesIn: 'Chile'.
>
> I have to admit I am still learning SPARQL, but the more queries I execute, the more I discover linked data structure, so I will add convenience methods for easy parsing results.
>
> Cheers,
>
> Hernán
>
>
>
> _______________________________________________
> Moose-dev mailing list
> Moose-dev(a)iam.unibe.ch
> https://www.iam.unibe.ch/mailman/listinfo/moose-dev
March 3, 2014
Re: [Pharo-dev] understanding postgresv2
by Tudor Girba
Thank you, Yanni!
Doru
On Mon, Mar 3, 2014 at 12:11 AM, Yanni Chiu <yanni(a)rogers.com> wrote:
> Hmmm. Didn't remember that was there. IIRC, it was released under Squeak
> Licence, via SqueakMap. Then when migrated to squeaksource.com, I believe
> it was marked as MIT. I've lost track of where it's being actively
> maintained, but please go ahead and remove or update the copyright text in
> the comment to MIT.
> --
> Yanni
>
>
> On 02/03/2014 11:36 AM, Tudor Girba wrote:
>
>> Another thing I see in the comment of PGConnection is this:
>> Copyright (c) 2001-2003 by Yanni Chiu. All Rights Reserved.
>>
>> Does anyone know the actual license?
>>
>> Doru
>>
>>
>> On Sun, Mar 2, 2014 at 5:34 PM, Tudor Girba <tudor(a)tudorgirba.com
>> <mailto:tudor@tudorgirba.com>> wrote:
>>
>> Hi,
>>
>> I am trying to understand how PostgresV2 is implemented because I
>> would like to build some inspector support for it, and I encounter a
>> couple of issues. In case anyone knows the answer, it would speed up
>> my effort:
>>
>> - Why is result an instance variable in PGConnection? Making it a
>> variable always returns the same object when executing a query and
>> that is a bit of a pain.
>>
>> - Why does the PGResult have the possibility of holding multiple
>> PGResultSets? When is it possible to have multiple at the same time?
>> (when you execute a query, the result is being initialized)
>>
>> - When running something like
>> connection execute: 'select * from ...'
>> the PGResultSet already includes all rows of the query. Is it not
>> possible to have a stream-like functionality in which the actual
>> rows are retrieved only on demand? (a similar functionality exists
>> in DBXTalk)
>>
>> - What is the difference between PGAsciiRow and PGDataRow?
>>
>> Doru
>>
>> --
>> www.tudorgirba.com <http://www.tudorgirba.com>
>>
>>
>> "Every thing has its own flow"
>>
>>
>>
>>
>> --
>> www.tudorgirba.com <http://www.tudorgirba.com>
>>
>>
>> "Every thing has its own flow"
>>
>
>
--
www.tudorgirba.com
"Every thing has its own flow"
March 3, 2014
WhatsUp from: 2014-03-03 until: 2014-03-16
by seaside@rmod.lille.inria.fr
Hi! We're sending this automatic email twice a month, to give the community an opportunity to easily know what's happening and to coordinate efforts. Just answer informally, and feel free to spawn discussions thereafter!
### Here's what I've been up to since the last WhatsUp:
- $HEROIC_ACHIEVEMENTS_OR_DISMAL_FAILURES_OR_SIMPLE_BORING_NECESSARY_TASKS
### What's next, until 2014-03-16 (*):
- $NEXT_STEPS_TOWARDS_WORLD_DOMINATION
(*) we'll be expecting results by then ;)
March 3, 2014
Re: [Pharo-dev] [Pharo-business] [ANN] DBPedia: Query Wikipedia from Pharo
by Hernán Morales Durand
2014-03-02 21:22 GMT-03:00 Alexandre Bergel <alexandre.bergel(a)me.com>:
> Iâve just tried and it works pretty well! Impressive!
>
> Below I describe a small example that fetches some data about the US
> Universities from DBPedia and visualize them using Roassal2.
>
> Pick a fresh 3.0 image.
>
> First, you need to load Hernán work, Svenâs NeoJSON, and Roassal 2 (If you
> are using a Moose Image, there is no need to load Roassal2 since it is
> already in):
> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
> Gofer it
> smalltalkhubUser: 'SvenVanCaekenberghe' project: 'Neo';
> package: 'ConfigurationOfNeoJSON';
> load.
> ((Smalltalk at: #ConfigurationOfNeoJSON) load).
>
> Gofer it
> smalltalkhubUser: 'hernan' project: 'DBPedia';
> package: 'DBPedia';
> load.
>
> Gofer it
> smalltalkhubUser: 'ObjectProfile' project: 'Roassal2';
> package: 'ConfigurationOfRoassal2';
> load.
> ((Smalltalk at: #ConfigurationOfRoassal2) loadBleedingEdge).
>
> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
>
> Using Roassal2, I was able to render some data extracted from dbpedia:
>
> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
> | map locations rawData rawData2 rawData3 |
> map := RTMapBuilder new.
>
> map countries: #('UnitedStates' 'Canada' 'Mexico').
> map color: Color veryVeryLightGray.
>
> rawData := DBPediaSearch universitiesInUS.
> rawData2 := ((NeoJSONReader fromString: rawData) at: #results) at:
> #bindings.
> rawData3 := rawData2 select: [ :d | d keys includesAll: #('label' 'long'
> 'lat') ] thenCollect: [ :d | { (Float readFrom: ((d at: 'long') at:
> 'value')) . (Float readFrom: ((d at: 'lat') at: 'value')) . (d at: 'label'
> ) at: 'value' } ].
>
>
> locations := rawData3.
> locations do: [ :array |
> map cities addCityNamed: array third location: array second @ array first
> ].
> map cities shape size: 8; color: (Color blue alpha: 0.03).
> map cities: (locations collect: #third).
>
> map scale: 2.
>
> map render.
> map view openInWindowSized: 1000 @ 500.
> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
>
> This is what you get:
>
>
> This is a small example. Naturally, adding popup for locations is trivial
> to add.
>
> I have described this on our Facebook page:
>
> https://www.facebook.com/ObjectProfile/photos/a.341189379300999.82969.34054…
>
>
Super cool!! Thanks for sharing the nice mapping.
Hernán, since SPARQL is a bit obscure,
>
Absolutely, SPARQL is like the Assembler of the web.
> it would be great if you could add some more example, and also, how to
> parametrize the examples. For example, now we can get data for the US, how
> to modify your example to get them for France or Chile?
>
>
Ok, uploaded an updated version. I have parametrized the query triplets as
#universitiesIn: englishCountryName,
DBPediaSearch universitiesIn: 'France'.
DBPediaSearch universitiesIn: 'Chile'.
I have to admit I am still learning SPARQL, but the more queries I execute,
the more I discover linked data structure, so I will add convenience
methods for easy parsing results.
Cheers,
Hernán
March 3, 2014
Re: [Pharo-dev] [Pharo-business] [ANN] DBPedia: Query Wikipedia from Pharo
by Alexandre Bergel
A followup from the previous post. Fetching country population and charting them using GraphET:
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
| query data diagram |
query := DBPediaSearch new
setJsonFormat;
setDebugOn;
timeout: 3000;
query: 'SELECT DISTINCT ?name ?population
WHERE {
?country a dbpedia-owl:Country .
?country rdfs:label ?name .
FILTER
(langMatches(lang(?name), "en"))
values ?hasPopulation { dbpprop:populationEstimatedbpprop:populationCensus }
OPTIONAL { ?country ?hasPopulation ?population }
FILTER (isNumeric(?population))
FILTER NOT EXISTS { ?country dbpedia-owl:dissolutionYear ?yearEnd } { ?country dbpprop:iso3166code ?code . }
UNION { ?country dbpprop:iso31661Alpha ?code . }
UNION { ?country dbpprop:countryCode ?code . }
UNION { ?country a yago:MemberStatesOfTheUnitedNations . }}';
execute.
data := (((NeoJSONReader fromString: query) at:#results) at: #bindings) collect: [ :entry | Array with: ( (entry at: #name) at: #value ) with: ( (entry at: #population) at: #value ) asInteger ].
"Use GraphET to render all this"
diagram := GETDiagramBuilder new.
diagram verticalBarDiagram
models: (data reverseSortedAs: #second);
y: #second;
regularAxisAsInteger;
titleLabel: 'Size of countries';
yAxisLabel: 'Population'.
diagram interaction popupText.
diagram open
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Cheers,
Alexandre
On Mar 2, 2014, at 9:22 PM, Alexandre Bergel <alexandre.bergel(a)me.com> wrote:
> Iâve just tried and it works pretty well! Impressive!
>
> Below I describe a small example that fetches some data about the US Universities from DBPedia and visualize them using Roassal2.
>
> Pick a fresh 3.0 image.
>
> First, you need to load Hernán work, Svenâs NeoJSON, and Roassal 2 (If you are using a Moose Image, there is no need to load Roassal2 since it is already in):
> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
> Gofer it
> smalltalkhubUser: 'SvenVanCaekenberghe' project: 'Neo';
> package: 'ConfigurationOfNeoJSON';
> load.
> ((Smalltalk at: #ConfigurationOfNeoJSON) load).
>
> Gofer it
> smalltalkhubUser: 'hernan' project: 'DBPedia';
> package: 'DBPedia';
> load.
>
> Gofer it
> smalltalkhubUser: 'ObjectProfile' project: 'Roassal2';
> package: 'ConfigurationOfRoassal2';
> load.
> ((Smalltalk at: #ConfigurationOfRoassal2) loadBleedingEdge).
>
> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
>
> Using Roassal2, I was able to render some data extracted from dbpedia:
>
> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
> | map locations rawData rawData2 rawData3 |
> map := RTMapBuilder new.
>
> map countries: #('UnitedStates' 'Canada' 'Mexico').
> map color: Color veryVeryLightGray.
>
> rawData := DBPediaSearch universitiesInUS.
> rawData2 := ((NeoJSONReader fromString: rawData) at: #results) at: #bindings.
> rawData3 := rawData2 select: [ :d | d keys includesAll: #('label' 'long' 'lat') ] thenCollect: [ :d | { (Float readFrom: ((d at: 'long') at: 'value')) . (Float readFrom: ((d at: 'lat') at: 'value')) . (d at: 'label' ) at: 'value' } ].
>
>
> locations := rawData3.
> locations do: [ :array |
> map cities addCityNamed: array third location: array second @ array first ].
> map cities shape size: 8; color: (Color blue alpha: 0.03).
> map cities: (locations collect: #third).
>
> map scale: 2.
>
> map render.
> map view openInWindowSized: 1000 @ 500.
> -=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
>
> This is what you get:
>
> <Screen Shot 2014-03-02 at 9.09.57 PM.png>
>
> This is a small example. Naturally, adding popup for locations is trivial to add.
>
> I have described this on our Facebook page:
> https://www.facebook.com/ObjectProfile/photos/a.341189379300999.82969.34054…
>
> Hernán, since SPARQL is a bit obscure, it would be great if you could add some more example, and also, how to parametrize the examples. For example, now we can get data for the US, how to modify your example to get them for France or Chile?
>
> Cheers,
> Alexandre
>
>
> On Mar 2, 2014, at 3:43 PM, Hernán Morales Durand <hernan.morales(a)gmail.com> wrote:
>
>> I have uploaded a new configuration so you can query the english Wikipedia dataset from Pharo 3 using SPARQL. Some examples follow:
>>
>> 1) Retrieve in JSON movies from the beautiful Julianne Moore:
>>
>> | jsonResults |
>> jsonResults := DBPediaSearch new
>> setJsonFormat;
>> timeout: 5000;
>> query: 'SELECT DISTINCT ?filmName WHERE {
>> ?film foaf:name ?filmName .
>> ?film dbpedia-owl:starring ?actress .
>> ?actress foaf:name ?name.
>> FILTER(contains(?name, "Julianne"))
>> FILTER(contains(?name, "Moore"))
>> }';
>> execute
>>
>> To actually get only the titles using NeoJSON:
>>
>> ((((NeoJSONReader fromString: jsonResults) at: #results) at: #bindings)
>> collect: [ : entry | entry at: #filmName ]) collect: [ : movie | movie at: #value ]
>>
>>
>> 2) Retrieve in XML which genre plays those crazy Dream Theater guys :
>>
>> DBPediaSearch new
>> setXmlFormat;
>> setDebugOn;
>> timeout: 5000;
>> query: 'SELECT DISTINCT ?genreLabel
>> WHERE {
>> ?resource dbpprop:genre ?genre.
>> ?resource rdfs:label "Dream Theater"@en.
>> ?genre rdfs:label ?genreLabel
>> FILTER (lang(?genreLabel)="en")
>> }
>> LIMIT 100';
>> execute
>>
>> More examples are available in DBPediaSearch class side. You can install it from the Configuration Browser.
>> If you want to contribute, just ask me and you will be added as contributor.
>> Best regards,
>>
>> Hernán
>>
>> _______________________________________________
>> Pharo-business mailing list
>> Pharo-business(a)lists.pharo.org
>> http://lists.pharo.org/mailman/listinfo/pharo-business_lists.pharo.org
>
> --
> _,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
> Alexandre Bergel http://www.bergel.eu
> ^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
>
>
>
--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
March 3, 2014
Re: [Pharo-dev] [Pharo-business] [ANN] DBPedia: Query Wikipedia from Pharo
by Alexandre Bergel
Iâve just tried and it works pretty well! Impressive!
Below I describe a small example that fetches some data about the US Universities from DBPedia and visualize them using Roassal2.
Pick a fresh 3.0 image.
First, you need to load Hernán work, Svenâs NeoJSON, and Roassal 2 (If you are using a Moose Image, there is no need to load Roassal2 since it is already in):
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Gofer it
smalltalkhubUser: 'SvenVanCaekenberghe' project: 'Neo';
package: 'ConfigurationOfNeoJSON';
load.
((Smalltalk at: #ConfigurationOfNeoJSON) load).
Gofer it
smalltalkhubUser: 'hernan' project: 'DBPedia';
package: 'DBPedia';
load.
Gofer it
smalltalkhubUser: 'ObjectProfile' project: 'Roassal2';
package: 'ConfigurationOfRoassal2';
load.
((Smalltalk at: #ConfigurationOfRoassal2) loadBleedingEdge).
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
Using Roassal2, I was able to render some data extracted from dbpedia:
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
| map locations rawData rawData2 rawData3 |
map := RTMapBuilder new.
map countries: #('UnitedStates' 'Canada' 'Mexico').
map color: Color veryVeryLightGray.
rawData := DBPediaSearch universitiesInUS.
rawData2 := ((NeoJSONReader fromString: rawData) at: #results) at: #bindings.
rawData3 := rawData2 select: [ :d | d keys includesAll: #('label' 'long' 'lat') ] thenCollect: [ :d | { (Float readFrom: ((d at: 'long') at: 'value')) . (Float readFrom: ((d at: 'lat') at: 'value')) . (d at: 'label' ) at: 'value' } ].
locations := rawData3.
locations do: [ :array |
map cities addCityNamed: array third location: array second @ array first ].
map cities shape size: 8; color: (Color blue alpha: 0.03).
map cities: (locations collect: #third).
map scale: 2.
map render.
map view openInWindowSized: 1000 @ 500.
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
This is what you get:
This is a small example. Naturally, adding popup for locations is trivial to add.
I have described this on our Facebook page:
https://www.facebook.com/ObjectProfile/photos/a.341189379300999.82969.34054…
Hernán, since SPARQL is a bit obscure, it would be great if you could add some more example, and also, how to parametrize the examples. For example, now we can get data for the US, how to modify your example to get them for France or Chile?
Cheers,
Alexandre
On Mar 2, 2014, at 3:43 PM, Hernán Morales Durand <hernan.morales(a)gmail.com> wrote:
> I have uploaded a new configuration so you can query the english Wikipedia dataset from Pharo 3 using SPARQL. Some examples follow:
>
> 1) Retrieve in JSON movies from the beautiful Julianne Moore:
>
> | jsonResults |
> jsonResults := DBPediaSearch new
> setJsonFormat;
> timeout: 5000;
> query: 'SELECT DISTINCT ?filmName WHERE {
> ?film foaf:name ?filmName .
> ?film dbpedia-owl:starring ?actress .
> ?actress foaf:name ?name.
> FILTER(contains(?name, "Julianne"))
> FILTER(contains(?name, "Moore"))
> }';
> execute
>
> To actually get only the titles using NeoJSON:
>
> ((((NeoJSONReader fromString: jsonResults) at: #results) at: #bindings)
> collect: [ : entry | entry at: #filmName ]) collect: [ : movie | movie at: #value ]
>
>
> 2) Retrieve in XML which genre plays those crazy Dream Theater guys :
>
> DBPediaSearch new
> setXmlFormat;
> setDebugOn;
> timeout: 5000;
> query: 'SELECT DISTINCT ?genreLabel
> WHERE {
> ?resource dbpprop:genre ?genre.
> ?resource rdfs:label "Dream Theater"@en.
> ?genre rdfs:label ?genreLabel
> FILTER (lang(?genreLabel)="en")
> }
> LIMIT 100';
> execute
>
> More examples are available in DBPediaSearch class side. You can install it from the Configuration Browser.
> If you want to contribute, just ask me and you will be added as contributor.
> Best regards,
>
> Hernán
>
> _______________________________________________
> Pharo-business mailing list
> Pharo-business(a)lists.pharo.org
> http://lists.pharo.org/mailman/listinfo/pharo-business_lists.pharo.org
--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.
March 3, 2014
Re: [Pharo-dev] understanding postgresv2
by Yanni Chiu
On 02/03/2014 11:34 AM, Tudor Girba wrote:
>
> - Why is result an instance variable in PGConnection? Making it a
> variable always returns the same object when executing a query and that
> is a bit of a pain.
Because the PGConnection is designed as an active object, controlled by
a state machine. Depending on the connection state, the result set
associated with the connection is either valid or not valid.
The layer above PGConnection should not hold onto any PGResult directly,
since it's internal data structure of the Postgres client. The object
mapping layer would be expected to copy data values from the result rows.
> - Why does the PGResult have the possibility of holding multiple
> PGResultSets? When is it possible to have multiple at the same time?
> (when you execute a query, the result is being initialized)
IIRC, something like:
connection execute 'select * from foo1; select * from foo2'
will get you multiple result sets.
> - When running something like
> connection execute: 'select * from ...'
> the PGResultSet already includes all rows of the query. Is it not
> possible to have a stream-like functionality in which the actual rows
> are retrieved only on demand? (a similar functionality exists in DBXTalk)
IIUC (it's been a long time since I looked at it), the V3 protocol has
this streaming support. In the V2 protocol, I think you have to read and
discard the results. As for DBXTalk, it's likely using the V3 protocol.
> - What is the difference between PGAsciiRow and PGDataRow?
The message format is documented at:
http://www.postgresql.org/docs/7.1/static/protocol-message-formats.html
I see an AsciiRow and a BinaryRow there, but no DataRow. So, I don't
know where DataRow comes from, unless it's from an even older version of
the protocol docs (original development was done on Postgres version
6.4, IIRC).
March 2, 2014