In
“Implementing GraphQL as a Query Language for Deductive Databases in SWI–Prolog Using DCGs, Quasi Quotations, and Dicts” by Falco Nogatz (@fnogatz) and Dietmar Seipel (pdf)
it notes
we intend to adopt EDCG rules for writing more powerful grammars in a simpler way in the future.
Is there more that has/can be shared regarding the use of EDCG with Quasiquotations?
Currently looking at existing and other ways to create Cytoscape visual graphs (nodes and edges) from Prolog and this is an avenue worth exploring.
EDIT
For those looking for related source code (not identical) to the paper see: Pack - graphql
Install instructions
- First, optionally check to see if it is already installed.
?- pack_list_installed.
Installed packages (18):
i callgraph@0.4.1 - Predicate call graph visualisation
i clitable@1.0.8 - Pretty unicode tables for the CLI with Prolog
i dcgutils@1.1.3 - DCG related utilities
i dictoo@1.4.111 - Dict-like OO Syntax
i edcg@0.9.1.2 - Extended DCG
i fileutils@0.3.5 - Utilities for reading, writing and finding files
i fnotation@0.0.3 - Function notation for Prolog
i func@0.4.2 - Function application and composition
i function_expansion@0.1.2 - Help for writing function-like macros
i genutils@0.3.8 - General miscellaneous utilities
i gvar_syntax@1.5.666 - Global Variable Syntax
i list_util@0.13.0 - Predicates for working with lists
i logicmoo_utils@1.5.666 - Common predicates that are used throughout LogicMOO Software
i pfc@1.4.111 - Pfc -- a package for forward chaining in Prolog
i predicate_streams@1.5.666 - Implement your own Abstract Predicate Streams
i quickcheck@0.3.0 - QuickCheck randomized testing
i sldnfdraw@1.61 - SLDNF Draw is a Prolog program that draws SLDNF Trees in LaTeX
i swipe@0.2.6 - Shell pipeline construction with type checking
true.
If not installed then install it.
NB There are two identical versions of the pack. I would suggest using graphql
as it does not have the -
in the name which can cause problems when the name graphql-swipl
is not single quoted.
?- pack_search(graphql).
% Contacting server at https://www.swi-prolog.org/pack/query ... ok
p graphql@0.0.1 - GraphQL Prolog Library
p graphql-swipl@0.0.1 - GraphQL Prolog Library
true.
?- pack_install(graphql).
% Contacting server at https://www.swi-prolog.org/pack/query ... ok
Install graphql@0.0.1 from GIT at https://github.com/NaohiroTamura/graphql.git Y/n?
% Cloning into 'c:/users/eric/appdata/local/swi-prolog/pack/graphql'...
% Contacting server at https://www.swi-prolog.org/pack/query ... ok
% "graphql.git" was downloaded 17 times
Package: graphql
Title: GraphQL Prolog Library
Installed version: 0.0.1
Author: Naohiro Tamura <naohirot@jp.fujitsu.com>
Home page: https://github.com/NaohiroTamura
Activate pack "graphql" Y/n?
true.
For more working examples of Quasiquotations with SWI-Prolog see Anne’s Creating Web Applications in SWI-Prolog