From mboxrd@z Thu Jan 1 00:00:00 1970 From: swedebugia Subject: Re: [Feature idea] Adding wikidata, wikipedia & screenshot-url fields to package-recipes Date: Fri, 2 Nov 2018 12:37:15 +0100 Message-ID: References: <20181101102150.naklct2uiujtp2rl@thebird.nl> <301f9d56-2091-2fbc-da89-c2ca53d0f580@riseup.net> <20181102072426.t6od5xusftivw6t6@thebird.nl> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="------------7520E5609670D6DCB4D544D9" Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:53852) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gIXg7-0005RS-SL for guix-devel@gnu.org; Fri, 02 Nov 2018 07:31:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gIXg4-0002Bl-LZ for guix-devel@gnu.org; Fri, 02 Nov 2018 07:31:51 -0400 Received: from mx1.riseup.net ([198.252.153.129]:60193) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gIXg4-0002BR-Bk for guix-devel@gnu.org; Fri, 02 Nov 2018 07:31:48 -0400 In-Reply-To: <20181102072426.t6od5xusftivw6t6@thebird.nl> Content-Language: sv-FI List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: Pjotr Prins Cc: guix-devel@gnu.org This is a multi-part message in MIME format. --------------7520E5609670D6DCB4D544D9 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit On 2018-11-02 08:24, Pjotr Prins wrote: > On Thu, Nov 01, 2018 at 11:33:48PM +0100, swedebugia wrote: >> When you have a proof-of-concept we can even consider writing a >> paper about it. That would probably be fun :) I did not write a paper for a long time and never in the field of computing. >> This wikidata endeavor would likely take some time for me to >> accomplish with a good mentor. > > No problem! I think it is actually a very good learning project. We > can help. Start small is my advice. Thank you! I feel motivated. > >> First up is deciding whether the core procedures interacting with >> wikidata should be in guix or as a separate module. I suggest >> separate module. > > Agree. I think it can be a tool that is separate from Guix itself. > Just start with a simple query and store that either as an > S-expression or as JSON. I think (eventually) we ought to do both so > other languages may use output too. Have a look at the tooling that > generates the website. Ok. Is there a json guile module? Will take a close look at the python module. > >> Then writing client procedures to interface with the SPARQL API in >> wikidata. This has already been done in python 3 (beta) see >> [3]https://github.com/dahlia/wikidata gplv3+ >> >> We could piggyback on this client (essentially making guix >> dependent on python :/) or better yet contribute to one of the >> existing guile sql libraries: > > Personally I would use the Python stuff first and then slowly > replace that with Guile. That way you get to results fast and we can > improve over time. I personally take no issue with mixing stuff. And > because it is a separate tool it is your choice anyway. I think also, > initially, we should build a separate website that can display all > this information. That way you have full freedom on implementation > and experiments. How would I go about mixing python and guile? Export the list of package records from guile -> JSON and import in a python script? Can I call a python-script from guile and receive input from it? So something like: iterate over record fields calling a python script to fetch data from wikidata acting on the data feeding it to the console/web template code fire up the webserver serving the html Cheers Swedebugia --------------7520E5609670D6DCB4D544D9 Content-Type: text/html; charset=utf-8 Content-Transfer-Encoding: 7bit

On 2018-11-02 08:24, Pjotr Prins wrote:
> On Thu, Nov 01, 2018 at 11:33:48PM +0100, swedebugia wrote: >> When you have a proof-of-concept we can even consider writing a >> paper about it.
That would probably be fun :) I did not write a paper for a long time and never in the field of computing.

>> This wikidata endeavor would likely take some time for me to >> accomplish with a good mentor. > > No problem! I think it is actually a very good learning project. We > can help. Start small is my advice.
Thank you! I feel motivated.
> >> First up is deciding whether the core procedures interacting with >> wikidata should be in guix or as a separate module. I suggest >> separate module. > > Agree. I think it can be a tool that is separate from Guix itself. > Just start with a simple query and store that either as an > S-expression or as JSON. I think (eventually) we ought to do both so > other languages may use output too. Have a look at the tooling that > generates the website.
Ok. Is there a json guile module?
Will take a close look at the python module.

> >> Then writing client procedures to interface with the SPARQL API in >> wikidata. This has already been done in python 3 (beta) see >> [3]https://github.com/dahlia/wikidata gplv3+ >> >> We could piggyback on this client (essentially making guix >> dependent on python :/) or better yet contribute to one of the >> existing guile sql libraries: > > Personally I would use the Python stuff first and then slowly > replace that with Guile. That way you get to results fast and we can > improve over time. I personally take no issue with mixing stuff. And > because it is a separate tool it is your choice anyway. I think also, > initially, we should build a separate website that can display all > this information. That way you have full freedom on implementation > and experiments.
How would I go about mixing python and guile?
Export the list of package records from guile -> JSON and import in a python script?
Can I call a python-script from guile and receive input from it?

So something like:
iterate over record fields
calling a python script to fetch data from wikidata
acting on the data
feeding it to the console/web template code
fire up the webserver serving the html

Cheers
Swedebugia

--------------7520E5609670D6DCB4D544D9--