GQL in Virtuoso: History, Showcase and Live Results

How GQL came to be, where it sits among query languages, and what Virtuoso's sixteen showcase queries return.

Executive SummaryBy Kingsley Uyi Idehen · 2026-11-08

Synopsis

GQL became an ISO standard in 2024. Two chapters of GQL Essentials, by Dominik Tomaszuk, trace the road to it and place it among SQL, RDF and other query traditions.

OpenLink then published sixteen GQL queries for Virtuoso: PageRank and other graph measures, and shortest paths, over a five-person graph. Virtuoso runs GQL by translating it to SPARQL, and this page runs the queries live, three basic examples first, keeping the post's line between ISO GQL and Virtuoso's own bif: functions.

19runnable GQL queries
5people in the demo graph
3hops, Alice to Eve

“The bif: analytics functions in these examples are Virtuoso extensions; they are not functions specified by ISO GQL.”

View this analysis as a KG entity
Section 1

From Network Databases to GQL

Each step answers a limit in the one before it, and the field splits into RDF triples and property graphs. Source: GQL Essentials, chapter 1, by Dominik Tomaszuk.

Dots are steps and arrows follow the chapter's account. Scroll sideways on a narrow screen.

Lineage of database models and query languagesTwelve milestones from the Integrated Data Store to GQL, grouped into four lanes: database models, graph knowledge, the RDF line and the property graph line.Database modelsGraph knowledgeRDF lineProperty graph lineIntegrated Data Store1n.d.IDSIBM IMS and the hierarchical model21968IBM IMSCODASYL Data Base Task Group31969CODASYL DBTGCODASYL network model41971CODASYLnetworkConceptual Graphs51976ConceptualGraphsANSI X3H2 and the Network Data Language61978ANSI NDLRegular path queries71987Path queriesThe Semantic Web and RDF81998Semantic WebSPARQL92004SPARQLNeo4j and Cypher102007Neo4j, CypherSQL/PGQ112023SQL/PGQGQL122024GQL
Read the twelve steps
  1. Integrated Data Store no date given

    IDS, designed by Charles Bachman, laid the groundwork for the network model of databases.

  2. IBM IMS and the hierarchical model 1968

    IBM introduced the Information Management System in 1968. It stored data as record types with named fields, and every record except the root had a single parent. Part data had to be repeated across suppliers, and a part without suppliers could not be stored.

  3. CODASYL Data Base Task Group 1969

    CODASYL created the Data Base Task Group in the late 1960s. Its reports of 1969 and 1971 proposed a standard sublanguage for database applications embedded in COBOL.

  4. CODASYL network model 1971

    The 1971 and 1973 reports dropped the tree. A record could have several parents, and connections were "sets": one owner record type related to many child record types.

  5. Conceptual Graphs 1976

    John F. Sowa proposed Conceptual Graphs in the mid-1970s (1976) and published the book in 1984. They aim to be readable by people and processable by machines, a bridge between natural language and machine languages.

  6. ANSI X3H2 and the Network Data Language 1978

    In 1978 ANSI formed the committee now called INCITS DM32, or "H2". It worked on a Network Data Language based on the 1971 DBTG report, to give database products a compatible, competitive market.

  7. Regular path queries 1987

    Regular path queries date from 1987 and conjunctive regular path queries from 1990. They showed interest in querying graph structure beyond what SQL and RDF handled well.

  8. The Semantic Web and RDF 1998

    Tim Berners-Lee described the Semantic Web in the mid-1990s. The W3C was formed, and a 2001 Scientific American article gave the vision momentum. The chapter notes that only part of it was realized in web markup.

  9. SPARQL 2004

    SPARQL, introduced in 2004 and refreshed in 2008, retrieves data stored as RDF. Its property paths resemble regular path queries.

  10. Neo4j and Cypher 2007

    Neo4j launched in 2007 and its Cypher language in 2011. The property graph model puts records of properties on both nodes and relationships, which the chapter links to knowledge graphs for AI and data mesh architectures.

  11. SQL/PGQ 2023

    SQL Property Graph Queries were standardized in 2023.

  12. GQL 2024

    GQL was standardized in 2024 as ISO/IEC 39075. The chapter presents standardization as the route to interoperability, a competitive market and simpler data architectures.

Section 2

Where GQL Sits Among Query Traditions

Chapter 3 sets GQL against the traditions it draws on. Its running library example, Reader to LibraryAccount to Loan to Book, needs joins in a relational schema, nesting or cross-references in a document model, and stays a traversable path in a graph.

TraditionGQL inheritsGQL departsGaps the chapter names
Relational databases and SQL
  • Record orientation Typed collections of nodes or edges behave like tables and supply rows to binding tables.
  • Schema awareness Graph, node and edge types with key and unique constraints, and a high-level transaction view that validates constraints before completing.
  • Relationships as edges Relationships are edges with their own identity and properties, not values matched through foreign keys.
  • Binding tables and missing data Binding tables disallow duplicate column names, and missing information is usually a missing property rather than a null.
  • Path patterns Path patterns describe the shape of a traversal, where SQL uses recursive queries over joins.
  • Composition No general graph-returning subqueries or views that define persistent graphs. The chapter calls SQL the more mature and compositional language.
  • Constraints A weaker constraint repertoire than mature SQL: referential integrity, cardinality and rich domain constraints.
RDF and SPARQL
  • Pattern matching Graph pattern matching and queries across heterogeneous sources, which the chapter traces to SPARQL.
  • Reasoning Closed-world, constraint-oriented database reasoning, against open-world, entailment-oriented RDF reasoning.
None named in the chapter
Tree-based languages
  • Nesting Ideas for handling nested and hierarchical data, drawn from XPath, XQuery, JSONPath and SQL JSON support.
  • Graph-native Graph-native pattern and path querying, rather than tree and document navigation.
None named in the chapter
Key-value and document databases
  • Properties Key-value pairs map onto the properties of nodes and edges, and dynamic, evolving schemas follow document databases.
None named in the chapterNone named in the chapter

Scholarly lineage

Scholarly lineage of graph query

Logic-based queries (Kuper and Vardi, 1984), graph-oriented object models (Gyssens, Paredaens and Van Gucht, 1990), hypernodes (Levene and Poulovassilis, 1990), GraphDB (Guting, 1994), nested graphs (Poulovassilis and Levene, 1994), G-Log (Paredaens and others, 1995) and Sheng and others (1999). Semistructured work includes the Object Exchange Model with Lore and Lorel, and UnQL. An earlier formal treatment of GQL (Morra, 2021) covered a read-only fragment of the 2020 working draft and is background, not the standard.

The chapter's own takeaways

A comparative map across SQL, RDF/SPARQL and property-graph traditions. Closed-world against open-world reasoning, and graph-native pattern and path querying against tree and document navigation. It justified bag-based intermediate results and explicit scoping rules.

Section 3

What ISO GQL Covers and What Virtuoso Adds

Pattern matching and path queries belong to the ISO standard. The analytics calls do not.

The standard, ISO/IEC 39075:2024

ISO GQL

ISO/IEC 39075:2024

The standard for GQL on property graphs. According to the post it includes graph pattern matching and path queries.

Path matching in the showcase

The path examples near the end of the post use GQL path matching: SHORTEST PATH, the * and + quantifiers, and reachability.

Extensions and endpoint support

Virtuoso

bif: analytics functions

The analytics calls, such as bif:pagerank and bif:betweenness, are Virtuoso extensions. They are not functions specified by ISO GQL, and other implementations can provide different analytics functions and interfaces.

RDF 1.2 edge annotations

The weighted PageRank example reads an edge weight through RDF 1.2 annotations. It relies on the endpoint supporting RDF 1.2, and starts with VERSION "rdf 1.2".

Section 4

How Virtuoso Runs GQL

Virtuoso implements ISO/IEC 39075:2024 GQL as a translation layer over its SPARQL engine, written entirely in Virtuoso/PL SQL, so GQL and SPARQL can query the same RDF data. Sources: the Virtuoso GQL documentation and the live demo endpoint.

  1. 1GQL textThe query as written, selected with the language=gql parameter or a leading GQL keyword.
  2. 2Lexergql_lexer.sqlTurns the text into a vector of tokens.
  3. 3Parsergql_parser.sqlTurns the tokens into an abstract syntax tree.
  4. 4Translatorgql_translate.sqlTurns the tree into a SPARQL string and a translation context.
  5. 5SPARQL generatorgql_sparql_gen.sqlCombines the context and fragments into the final SPARQL.
  6. 6SPARQL engineVirtuosoVirtuoso's own SPARQL engine executes the query against the quad store.

Run it three ways

  • HTTP endpoint /sparql

    The /sparql endpoint with language=gql returns result rows directly.

  • Virtuoso/PL DB.DBA.GQL_RUN()

    DB.DBA.GQL_RUN() returns a vector of result rows.

  • Translation only DB.DBA.GQL_TO_SPARQL()

    DB.DBA.GQL_TO_SPARQL() returns the SPARQL without running it.

How the graph maps to RDF

  • Nodes

    Become RDF subjects, with rdf:type labels and property predicates.

  • Edges

    Become RDF predicates, with optional reification for edge properties.

  • Graphs

    Become named graphs in the quad store.

Status

  • Which editionedition

    The published documentation describes GQL for Virtuoso 0.6.0, in Virtuoso Open Source 7.2 and not yet in a tagged release. This page reports the newer edition running on the VEC demo endpoint, Virtuoso 07.20.3243.

  • Newer than the documentationobserved

    MATCH SHORTEST PATH, which the 0.6.0 documentation lists as returning no rows, returned a row from the demo endpoint on 2026-11-08. Read the documentation for syntax and the endpoint for current behavior.

Section 5

Start Here: Three Basic GQL Examples

Three examples closer to basic GQL than the analytics queries: a pattern over DBpedia, a virtual property graph, and an ASK. Each runs live.

1

Ten films directed by Spike Lee

A pattern over DBpedia: films whose dbo:director is Spike Lee, with film and director labels. The prefixes make dbo:Film a node label and dbo:director an edge label.

MATCHnode label film:dbo:Filmedge label [r:dbo:director]WHEREproperty access film.rdfs:labelDISTINCTLIMIT
PREFIX dbo: <http://dbpedia.org/ontology/>
PREFIX dbr: <http://dbpedia.org/resource/>

MATCH (film:dbo:Film)-[r:dbo:director]->(director)
WHERE director = dbr:Spike_Lee
RETURN DISTINCT
 film,
 film.rdfs:label as film_name,
 director,
 director.rdfs:label as ?directorName
LIMIT 10

See the live result

See the SPARQL Virtuoso generated
PREFIX dbo: <http://dbpedia.org/ontology/>
PREFIX dbr: <http://dbpedia.org/resource/>
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX gql: <http://dbpedia.org/gql/ontology/>

SELECT DISTINCT
  (?gql_n_film AS ?film)
  (?prop_1 AS ?film_name)
  (?gql_n_director AS ?director)
  (?prop_2 AS ?directorName)
WHERE {
  VALUES ?gql_n_director { <http://dbpedia.org/resource/Spike_Lee> }
  ?gql_n_film rdf:type <http://dbpedia.org/ontology/Film> .
  ?gql_n_film <http://dbpedia.org/ontology/director> ?gql_n_director .
  ?gql_n_film <http://www.w3.org/2000/01/rdf-schema#label> ?prop_1 .
  ?gql_n_director <http://www.w3.org/2000/01/rdf-schema#label> ?prop_2 .
  FILTER ((?gql_n_director = <http://dbpedia.org/resource/Spike_Lee>))
}
LIMIT 10

Shown on the endpoint's result page, 2026-11-09. Entity in the graph

Run and show resultsOpen in the query form

2

Customers in a virtual property graph

USE PROPERTY GRAPH selects bakery, a virtual property graph: a read-only graph mapped live over relational tables, with no data copied. The query lists its customers.

USE PROPERTY GRAPHnode label customerproperty access c.namealias with AS
USE PROPERTY GRAPH bakery
MATCH (c:customer)
RETURN
 c,
 c.name as name

See the live result

See the SPARQL Virtuoso generated
PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX gql: <http://dbpedia.org/pgraph/bakery/ontology#>

SELECT (?gql_n_c AS ?c) (?prop_1 AS ?name)
FROM <http://dbpedia.org/pgraph/bakery>
WHERE {
  ?gql_n_c rdf:type <http://dbpedia.org/pgraph/bakery/ontology#customer> .
  ?gql_n_c <http://dbpedia.org/pgraph/bakery/ontology#name> ?prop_1 .
}

Shown on the endpoint's result page, 2026-11-09. Entity in the graph

Run and show resultsOpen in the query formDocumentation for this example

Section 6

Anatomy of a Query: Basic, Then With Extensions

Take the basic Spike Lee query apart first, then the weighted PageRank, which adds Virtuoso extensions.

ISO GQL: pattern matchingVirtuoso extensionHover or focus a numbered part to light up its lines. Origins are marked only where the sources state them.

1PREFIX dbo: <http://dbpedia.org/ontology/>
PREFIX dbr: <http://dbpedia.org/resource/>
 
2MATCH (film:dbo:Film)-[r:dbo:director]->(director)
3WHERE director = dbr:Spike_Lee
4RETURN DISTINCT
film,
film.rdfs:label as film_name,
director,
director.rdfs:label as ?directorName
5LIMIT 10

Run and show resultsOpen in the query form

  1. 1
    PREFIX dbo: and dbr:

    Declares short names for the DBpedia ontology and resource namespaces, so dbo:Film and dbr:Spike_Lee stand for full IRIs. RDF classes and predicates become node labels and edge labels.

    Entity in the graph
  2. 2
    MATCH (film:dbo:Film)-[r:dbo:director]->(director)ISO GQL

    A pattern: a node film with the label dbo:Film, joined by a directed edge labelled dbo:director to a node director. Pattern matching belongs to ISO GQL.

    Entity in the graph
  3. 3
    WHERE director = dbr:Spike_Lee

    Keeps only the matches whose director node is the one identified by this DBpedia IRI.

    Entity in the graph
  4. 4
    RETURN DISTINCT film, film.rdfs:label as film_name, ...

    Returns each film and its label, and the director and its label. film.rdfs:label reads a property of a node, as names the column, and DISTINCT removes duplicate rows.

    Entity in the graph
  5. 5
    LIMIT 10

    Stops after ten rows.

    Entity in the graph
Section 7

Path Queries: Five Ways to Ask Alice-to-Eve

Alice is the start and Eve the destination. Each query asks a different question.

  1. 1

    Shortest-path matching

    Returns the pair when a path exists, without computing a length or a route.

    MATCH SHORTEST PATH (a)-[:foaf:knows*]->(b)
  2. 2

    Shortest-path length

    Returns the hop count alongside the endpoints.

    MATCH (a)-[:foaf:knows*]->(b)bif:shortest_path_length
  3. 3

    Shortest route

    Returns the node sequence, serialized as JSON for display.

    MATCH (a)-[:foaf:knows*]->(b)sql:obj2json
  4. 4

    Cheapest weighted route and total cost

    Returns the route and the total cost: the route is element 0 of the result and the cost is element 2.

    MATCH (a)-[:foaf:knows*]->(b)bif:GRAPH_SHORTEST_PATH_WEIGHTED
  5. 5

    Everyone reachable from Alice

    The + quantifier needs one or more foaf:knows edges and returns every node Alice can reach.

    MATCH (a)-[:foaf:knows+]->(b)
Section 8

Live Results: Basic Examples and Graph Measures

The basic examples ran on 2026-11-09 and the analytics queries on 2026-11-08. Every query returned a result; the urn:social graph holds five people, so it shows how the functions behave, not how they scale.

The basic examples, run on 2026-11-09

The urn:social measures, run on 2026-11-08

Measure
Route, Alice to Eve
The urn:social demo graphFive people linked by seven weighted knows relationships. Node size follows the selected measure.0.90.50.80.60.70.41AliceBobCarolDaveEve

PageRank

    Node size follows the measure; component and community measures color nodes by group. Numbers on arrows are edge weights.

    Show the numbers
    PersonPageRankPageRank (weighted)DegreeBetweennessClosenessEigenvectorTrianglesComponents (WCC)Components (SCC)Community (Louvain)
    Alice0.1620.184300.5710.3731000
    Bob0.1440.17130.1110.6670.2812000
    Carol0.2050.20940.2220.6670.4942000
    Dave0.2230.19830.510.5851011
    Eve0.265no row1000.4420021
    Section 9

    Reading the Chapters and the Showcase Together

    Agent-authored commentary joining a claim from the book to one from the OpenLink posts.

    Section 10

    Sources

    Pages read on 2026-11-08 and 2026-11-09; the 2019 overview is referenced only.

    SubjectCommunity post

    OpenLink GQL post

    Virtuoso Native Graph Analytics with GQL: Enhanced by Standardized Namespaces and Identifiers

    2026-11-06

    Sixteen GQL queries over urn:social with run links, and the line between ISO GQL and Virtuoso extensions.

    Read the source

    SubjectDocumentation

    Virtuoso GQL documentation

    GQL Documentation — Virtuoso

    No date on the page

    How Virtuoso translates GQL to SPARQL, runs it and maps graphs to RDF. It describes version 0.6.0; the demo endpoint runs a newer edition. The overview and bakery pages were read.

    Read the source

    ReferencedCommunity post

    SPARQL-BI overview, 2019

    Graph Analytics using Virtuoso's SPARQL-BI Extensions to SPARQL

    2019

    The earlier SPARQL-BI extensions that the engine-level analytics functions replace. Referenced, not read in full.

    Read the source

    Showcase

    GQL Showcase Queries

    B1Basic 1: Ten films directed by Spike LeeRun ▶
    PREFIX dbo: <http://dbpedia.org/ontology/>
    PREFIX dbr: <http://dbpedia.org/resource/>
    
    MATCH (film:dbo:Film)-[r:dbo:director]->(director)
    WHERE director = dbr:Spike_Lee
    RETURN DISTINCT
     film,
     film.rdfs:label as film_name,
     director,
     director.rdfs:label as ?directorName
    LIMIT 10

    Run live on 2026-11-09: 10 rows, for example Summer of Sam, 4 Little Girls and Do the Right Thing.

    Open in the query form

    B2Basic 2: Customers in a virtual property graphRun ▶
    USE PROPERTY GRAPH bakery
    MATCH (c:customer)
    RETURN
     c,
     c.name as name

    Run live on 2026-11-09: 3 rows, Alice, Bob and Carol.

    Open in the query form

    B3Basic 3: Is Spike Lee a person? (ASK)Run ▶
    PREFIX dbo: <http://dbpedia.org/ontology/>
    PREFIX dbr: <http://dbpedia.org/resource/>
    
    ASK MATCH (n:dbo:Person)
    WHERE n = dbr:Spike_Lee

    Run live on 2026-11-09: returned true.

    Open in the query form

    1Query 1: Weighted PageRank via RDF 1.2 edge annotationsRun ▶
    PREFIX ex: <#>
    PREFIX foaf: <http://xmlns.com/foaf/0.1/>
    
    VERSION "rdf 1.2"
    USE GRAPH <urn:social>
    MATCH (p)-[e:foaf:knows {ex:weight: w}]->(other)
    RETURN DISTINCT p,
      bif:GRAPH_PAGERANK_WEIGHTED(
        p,
        iri('urn:social'),
        iri('http://xmlns.com/foaf/0.1/knows'),
        iri('#weight')
      ) AS score
    ORDER BY score DESC

    Run live on 2026-11-08 against https://vec.demo.openlinksw.com/sparql: 4 rows. First row: #carol=0.209.

    Open in the query form

    2Query 2: Basic PageRankRun ▶
    PREFIX foaf: <http://xmlns.com/foaf/0.1/>
    
    USE GRAPH <urn:social>
    MATCH (p)-[:foaf:knows]-(other)
    RETURN DISTINCT p,
      bif:pagerank(
        p,
        iri('urn:social'),
        iri('http://xmlns.com/foaf/0.1/knows')
      ) AS score
    ORDER BY score DESC

    Run live on 2026-11-08 against https://vec.demo.openlinksw.com/sparql: 5 rows. First row: #eve=0.265.

    Open in the query form

    3Query 3: PageRank with damping, iteration limit, and toleranceRun ▶
    PREFIX foaf: <http://xmlns.com/foaf/0.1/>
    
    USE GRAPH <urn:social>
    MATCH (p)-[:foaf:knows]-(other)
    RETURN DISTINCT p,
      bif:pagerank(
        p,
        iri('urn:social'),
        iri('http://xmlns.com/foaf/0.1/knows'),
        0.9,
        500,
        0.000001
      ) AS score
    ORDER BY score DESC

    Run live on 2026-11-08 against https://vec.demo.openlinksw.com/sparql: 5 rows. First row: #eve=0.270.

    Open in the query form

    4Query 4: Degree centralityRun ▶
    PREFIX foaf: <http://xmlns.com/foaf/0.1/>
    
    USE GRAPH <urn:social>
    MATCH (p)-[:foaf:knows]-(other)
    RETURN DISTINCT p,
      bif:degree_centrality(
        p,
        iri('urn:social'),
        iri('http://xmlns.com/foaf/0.1/knows'),
        'both'
      ) AS score
    ORDER BY score DESC

    Run live on 2026-11-08 against https://vec.demo.openlinksw.com/sparql: 5 rows. First row: #carol=4.

    Open in the query form

    5Query 5: Betweenness centralityRun ▶
    PREFIX foaf: <http://xmlns.com/foaf/0.1/>
    
    USE GRAPH <urn:social>
    MATCH (p)-[:foaf:knows]-(other)
    RETURN DISTINCT p,
      bif:betweenness(
        p,
        iri('urn:social'),
        iri('http://xmlns.com/foaf/0.1/knows'),
        1,
        0
      ) AS score
    ORDER BY score DESC

    Run live on 2026-11-08 against https://vec.demo.openlinksw.com/sparql: 5 rows. First row: #dave=0.500.

    Open in the query form

    6Query 6: Closeness centralityRun ▶
    PREFIX foaf: <http://xmlns.com/foaf/0.1/>
    
    USE GRAPH <urn:social>
    MATCH (p)-[:foaf:knows]-(other)
    RETURN DISTINCT p,
      bif:closeness(
        p,
        iri('urn:social'),
        iri('http://xmlns.com/foaf/0.1/knows')
      ) AS score
    ORDER BY score DESC

    Run live on 2026-11-08 against https://vec.demo.openlinksw.com/sparql: 5 rows. First row: #dave=1.

    Open in the query form

    7Query 7: Eigenvector centralityRun ▶
    PREFIX foaf: <http://xmlns.com/foaf/0.1/>
    
    USE GRAPH <urn:social>
    MATCH (p)-[:foaf:knows]-(other)
    RETURN DISTINCT p,
      bif:eigenvector(
        p,
        iri('urn:social'),
        iri('http://xmlns.com/foaf/0.1/knows'),
        200,
        0.00001
      ) AS score
    ORDER BY score DESC

    Run live on 2026-11-08 against https://vec.demo.openlinksw.com/sparql: 5 rows. First row: #dave=0.585.

    Open in the query form

    8Query 8: Weakly connected components (WCC)Run ▶
    PREFIX foaf: <http://xmlns.com/foaf/0.1/>
    
    USE GRAPH <urn:social>
    MATCH (p)-[:foaf:knows]-(other)
    RETURN DISTINCT p,
      bif:wcc(
        p,
        iri('urn:social'),
        iri('http://xmlns.com/foaf/0.1/knows')
      ) AS score
    ORDER BY score DESC

    Run live on 2026-11-08 against https://vec.demo.openlinksw.com/sparql: 5 rows. First row: #alice=0.

    Open in the query form

    9Query 9: Strongly connected components (SCC)Run ▶
    PREFIX foaf: <http://xmlns.com/foaf/0.1/>
    
    USE GRAPH <urn:social>
    MATCH (p)-[:foaf:knows]-(other)
    RETURN DISTINCT p,
      bif:scc(
        p,
        iri('urn:social'),
        iri('http://xmlns.com/foaf/0.1/knows')
      ) AS score
    ORDER BY score DESC

    Run live on 2026-11-08 against https://vec.demo.openlinksw.com/sparql: 5 rows. First row: #eve=2.

    Open in the query form

    10Query 10: Community ID (Louvain)Run ▶
    PREFIX foaf: <http://xmlns.com/foaf/0.1/>
    
    USE GRAPH <urn:social>
    MATCH (p)-[:foaf:knows]-(other)
    RETURN DISTINCT p,
      bif:community_id(
        p,
        iri('urn:social'),
        iri('http://xmlns.com/foaf/0.1/knows')
      ) AS score
    ORDER BY score DESC

    Run live on 2026-11-08 against https://vec.demo.openlinksw.com/sparql: 5 rows. First row: #dave=1.

    Open in the query form

    11Query 11: TrianglesRun ▶
    PREFIX foaf: <http://xmlns.com/foaf/0.1/>
    
    USE GRAPH <urn:social>
    MATCH (p)-[:foaf:knows]-(other)
    RETURN DISTINCT p,
      bif:triangle_count(
        p,
        iri('urn:social'),
        iri('http://xmlns.com/foaf/0.1/knows')
      ) AS score
    ORDER BY score DESC

    Run live on 2026-11-08 against https://vec.demo.openlinksw.com/sparql: 5 rows. First row: #bob=2.

    Open in the query form

    12Query 12: Shortest-path matching with GQLRun ▶
    PREFIX foaf: <http://xmlns.com/foaf/0.1/>
    
    USE GRAPH <urn:social>
    MATCH SHORTEST PATH (a)-[:foaf:knows*]->(b)
    WHERE a = iri('#alice') AND b = iri('#eve')
    RETURN a, b

    Run live on 2026-11-08 against https://vec.demo.openlinksw.com/sparql: 1 row. First row: one match, #alice to #eve.

    Open in the query form

    13Query 13: Shortest-path length: Alice to EveRun ▶
    PREFIX foaf: <http://xmlns.com/foaf/0.1/>
    
    USE GRAPH <urn:social>
    MATCH (a)-[:foaf:knows*]->(b)
    WHERE a = iri('#alice') AND b = iri('#eve')
    RETURN DISTINCT a, b,
      bif:shortest_path_length(
        a,
        b,
        iri('urn:social'),
        iri('http://xmlns.com/foaf/0.1/knows')
      ) AS hops

    Run live on 2026-11-08 against https://vec.demo.openlinksw.com/sparql: 1 row. First row: #alice to #eve, 3 hops.

    Open in the query form

    14Query 14: Shortest route: return the node sequenceRun ▶
    PREFIX foaf: <http://xmlns.com/foaf/0.1/>
    
    USE GRAPH <urn:social>
    MATCH (a)-[:foaf:knows*]->(b)
    WHERE a = iri('#alice') AND b = iri('#eve')
    RETURN DISTINCT
      sql:obj2json(
        bif:shortest_path(
          a,
          b,
          iri('urn:social'),
          iri('http://xmlns.com/foaf/0.1/knows')
        )
      ) AS route

    Run live on 2026-11-08 against https://vec.demo.openlinksw.com/sparql: 1 row. First row: route ["#alice","#bob","#dave","#eve"].

    Open in the query form

    15Query 15: Cheapest weighted route and total costRun ▶
    PREFIX foaf: <http://xmlns.com/foaf/0.1/>
    
    USE GRAPH <urn:social>
    MATCH (a)-[:foaf:knows*]->(b)
    WHERE a = iri('#alice') AND b = iri('#eve')
    LET result = bif:GRAPH_SHORTEST_PATH_WEIGHTED(
      a,
      b,
      iri('urn:social'),
      iri('http://xmlns.com/foaf/0.1/knows'),
      iri('#weight'),
      1
    )
    RETURN DISTINCT
      sql:obj2json(bif:aref(result, 0)) AS route,
      bif:aref(result, 2) AS cost

    Run live on 2026-11-08 against https://vec.demo.openlinksw.com/sparql: 1 row. First row: route ["#alice","#carol","#dave","#eve"], cost 1.900.

    Open in the query form

    16Query 16: Path finding: everyone reachable from AliceRun ▶
    PREFIX foaf: <http://xmlns.com/foaf/0.1/>
    
    USE GRAPH <urn:social>
    MATCH (a)-[:foaf:knows+]->(b)
    WHERE a = iri('#alice')
    RETURN DISTINCT b

    Run live on 2026-11-08 against https://vec.demo.openlinksw.com/sparql: 4 rows. First row: nodes #carol, #bob, #dave, #eve.

    Open in the query form

    How-To

    How-To Guide

    1

    Write the query

    Choose the graph with USE GRAPH, declare PREFIX lines for the vocabularies, MATCH the relationship, and RETURN a node with a bif: analytics call or a path. The anatomy section above labels each part.

    2

    Run it with results

    Use "Run and show results" on any showcase query to execute it on the VEC demo endpoint and read the result table.

    3

    Edit it in the query form

    Use "Open in the query form" to load the same query into the endpoint form, change it, and run it yourself.

    4

    Check what is standard

    Treat MATCH, SHORTEST PATH and the * and + quantifiers as ISO GQL, and the bif: calls as Virtuoso extensions that other implementations may not offer.

    5

    Read the result in context

    A score describes the selected graph and the relationships recorded in it, not importance in general.

    FAQ

    Frequently Asked Questions

    GQL is the ISO/IEC 39075:2024 standard query language for property graphs. The OpenLink post says it includes graph pattern matching and path queries. The history chapter dates its standardization to 2024.

    The chapter runs from IDS and the CODASYL network model through IMS, Conceptual Graphs, the Semantic Web and SPARQL, regular path queries, Neo4j and Cypher, SQL/PGQ in 2023 and GQL in 2024. Standardization pressure is the thread.

    The chapter says a property graph puts records of properties, much like SQL rows, on both nodes and relationships. RDF-style graphs are triple-centric.

    It says standard languages give interoperability and a competitive market, and support scalable, less complex data architectures as AI and big data drive graph use.

    USE GRAPH <urn:social> names the graph. The MATCH pattern names the relationship, here foaf:knows, declared through a PREFIX so the edge label is an RDF predicate.

    A score for each matched node. The call takes the node, the graph IRI, the relationship IRI and, for some functions, parameters such as damping, iteration limit, tolerance, direction or normalization.

    It declares VERSION "rdf 1.2", matches the edge with a property map {ex:weight: w}, and passes iri('#weight') to bif:GRAPH_PAGERANK_WEIGHTED. The post says it depends on the endpoint's RDF 1.2 support.

    Each query has a run link to the VEC demo endpoint that opens it in the query form with language set to GQL. The posts say results depend on that service and its graph.

    Eight examples over urn:dbpedia:live, covering philosophers, doctoral advisers, academic connections, football clubs, music genres, mountain ranges and corporate ownership. They add breadth-first search and Jaccard similarity to the function set. The post writes them as SPARQL queries.

    It treats SQL as the main comparison. GQL inherits the record orientation and gives relationships first-class edges with their own properties. The chapter says GQL path patterns state multi-hop traversals by shape where SQL recursion gets verbose, and that SQL remains more mature and compositional.

    No general graph-returning subqueries or views that define persistent graphs, and a constraint repertoire weaker than mature SQL, especially referential integrity and cardinality constraints.

    The chapter says SPARQL's graph pattern matching and its handling of queries across heterogeneous sources are evident in GQL. It also contrasts open-world RDF reasoning with the closed-world, constraint-oriented reasoning of databases.

    Virtuoso implements GQL as a translation layer over its SPARQL engine. The query is lexed, parsed, translated to SPARQL and executed there. It can run through the /sparql endpoint with language=gql, through DB.DBA.GQL_RUN(), or be translated only with DB.DBA.GQL_TO_SPARQL().

    The newer edition running on the VEC demo endpoint, Virtuoso 07.20.3243. The published documentation describes an older edition, GQL for Virtuoso 0.6.0: for example, it lists plain SHORTEST PATH as returning no rows, while the demo endpoint returned a row. Use the documentation for syntax and the endpoint for current behavior.

    As a description of the structure in the selected graph, not a general measure of importance. The posts say missing or unevenly recorded relationships change what the network contains, so read the query scope with its results.

    Glossary

    Glossary of Terms

    GQL

    ISO/IEC 39075:2024, the standard query language for property graphs, with graph pattern matching and path queries.

    Property graph

    A graph data model with records of properties on both nodes and relationships, distinct from RDF.

    SPARQL

    The query language for RDF data, introduced in 2004 and refreshed in 2008. Its property paths resemble regular path queries.

    RDF

    The Resource Description Framework, a triple-centric model for graph data.

    Network model

    The CODASYL database model in which a record can have several parents, linked through sets.

    Hierarchical model

    The IMS model: record types in a strict tree where each record except the root has one parent.

    CODASYL

    The Conference on Data System Languages, whose Data Base Task Group issued influential database reports in 1969 and 1971.

    Conceptual graph

    A knowledge representation proposed by John F. Sowa, readable by people and processable by machines.

    Cypher

    The declarative query language of Neo4j, introduced in 2011.

    PageRank

    A ranking of nodes by the link structure of the selected graph.

    Centrality

    A family of measures of how prominent a node is. The showcase covers degree, betweenness, closeness and eigenvector centrality.

    Degree

    The number of connections a node has. The showcase counts both directions.

    Betweenness centrality

    A score for nodes by their role along shortest paths between other nodes.

    Closeness centrality

    A measure of how near a node is to the other nodes, based on paths through the graph.

    Eigenvector centrality

    A measure that gives more weight to connections with nodes that themselves score highly.

    Strongly connected components

    Groups of nodes in which directed paths connect the members in both directions.

    Louvain community detection

    A method that groups nodes into communities; the showcase returns a community ID per node.

    Shortest path

    Finding a path between two nodes with the fewest hops or the lowest total weight.

    ISO/IEC 39075:2024

    The ISO/IEC standard for GQL, published in 2024.

    Weakly connected components

    Groups of nodes connected when edge direction is disregarded.

    Triangle count

    The number of closed three-node patterns that include a node; a sign of local clustering.

    Regular path query

    A query that finds node pairs joined by a path whose edge labels match a regular expression; dated to 1987.

    SQL/PGQ

    SQL Property Graph Queries, standardized by ISO in 2023.

    RDF 1.2 edge annotation

    A value attached to an RDF relationship, such as a weight, that an analytics function can read.

    bif: analytics function

    A Virtuoso built-in function called in a query, such as bif:pagerank. A Virtuoso extension, not part of ISO GQL.

    SQL

    The relational query language and the main point of comparison for GQL in the positioning chapter.

    Binding table

    The table of variable bindings produced during query evaluation. In GQL its columns cannot share a name.

    GPML

    The graph pattern matching sublanguage of GQL, a declarative pattern language for graphs and paths.

    Closed-world and open-world reasoning

    Closed-world database reasoning treats absent data as false and enforces constraints; open-world RDF reasoning does not, and works by entailment.

    Virtual property graph

    A read-only property graph mapped live over existing relational tables, with no data copied. Created with CREATE VIRTUAL PROPERTY GRAPH and queried with USE PROPERTY GRAPH.

    Translation layer

    The Virtuoso GQL extension parses GQL and translates it to SPARQL, which the SPARQL engine then executes.

    VEC demo endpoint

    The OpenLink demo query service at vec.demo.openlinksw.com that the run links open.

    urn:social graph

    The named graph of five people linked by foaf:knows that the showcase queries use.

    Knowledge Graph Explorer 448 nodes · 1499 links

    Interactive graph visualization derived from the companion RDF. Click nodes to resolve, drag to explore. Graph data embedded from companion RDF at generation time.

    GQL in Virtuoso: History, Showcase and Live Results

    Nodes: 0 Links: 0
    Click SVG to activate zoom, click outside to release | Drag nodes to pin, double-click to unpin
    Classes Properties Instances
    SPARQL Workbench 3 sample queries

    Query this knowledge graph on URIBurner. The editor opens on the canonical SAMPLE entity-type summary (DAV named graph). Pick a recipe, edit freely, then run live or copy.

    Query editor

    ▶ Run live on URIBurner SELECT: text/x-html+tr | DESCRIBE/CONSTRUCT: text/x-html-nice-turtle