Function | AllegroGraph 9.0.1
Author: Franz Incorporated

Copyright (c) 2005 - 2026 Franz, Incorporated
Last updated 27 May 2026 at 10:35

# SPARQL Function

- Documentation Index
  - Release Notes
  - Quick Start
  - SSL/TLS Quick Start
  - Introduction
  - Setup and Configuration
    - Download
    - Server Installation
    - Server Configuration and Control
    - WebView
    - Database Upgrading
    - Managing Users
  - Server Management
    - Performance Tuning
    - Deleting Duplicate Triples
    - Purging Deleted Triples
    - Auditing
    - Managing Users
    - Replication
    - Point-in-Time Recovery
    - Transaction Log Archiving
    - Security Overview
    - Security Implementation
  - Tools
    - agtool
    - Data Loading
    - Data Export
    - Backup and Restore
    - Querying
    - RDFS++
    - Materializer
    - Event Scheduler
    - SHACL
  - Details
    - Triple Indices
    - Freetext Indices
    - Encoded IDs
    - Connection Pooling
    - N-dimensional Geospatial Overview
    - 2-D Geospatial
    - Temporal
    - Social Network
    - JavaScript
    - Datatypes
    - Data Conversion (Rapper)
    - Stored Procedures
    - Triple Attributes
    - Lineparse Format
  - Querying
    - SPARQL documentation summary
    - SPARQL Reference
    - SPIN
    - SPARQL Magic Properties
    - Prolog
  - 3rd-party tools
    - Solr text Indices
    - MongoDB integration
    - TopBraid Composer Plugin
    - Cloudera
  - Client APIs
    - Gruff
    - GraphTalker
    - REST/HTTP interface
    - HTTP reference
    - Javadocs (Sesame and Jena)
    - Python API
    - Lisp Reference
    - JavaScript
  - Tutorials
    - N-dimensional Geospatial
    - SPARQL Tutorial
    - Java Sesame
    - Java Jena
    - Python Sesame
    - Lisp
    - Prolog
    - More...
  - Other
    - Conferences and Seminars
    - Source Code on Github
    - Amazon EC2
    - Copyrights
  - Franz, Inc.

## http://franz.com/ns/allegrograph/6.5.0/fn#lookupRdfList

Lookup an RDF list in the current data set, associate it with a blank node, and return it.

The list can be identified with either one or two arguments. If only one is given then the list found starts at that subject; if two arguments are given, then they are used to search for the object(s) that have the arguments with subject and predicate. If there are multiple lists that match the search criteria, then all of their elements will be collected. If there are no such lists, then the resulting list will be empty. Note that the search will take the current SPARQL dataset and any GRAPH clauses into account.

The blank node returned can be used with other functions and magic properties such as sna:members. For example with this data:

    prefix : <ex://#>
    :a :startsList ( 1 2 3 4 ) .
    :b rdf:first :x ;
       rdf:rest (:y :z) .

The following query:

    select ?member \{
      bind(<http://franz.com/ns/allegrograph/6.5.0/fn#lookupRdfList>( :a, :startsList ) as ?list)
      ?member <http://franz.com/ns/allegrograph/4.11/sna/members> ?list .
    \}

Similarly,

    select ?member \{
      bind(<http://franz.com/ns/allegrograph/6.5.0/fn#lookupRdfList>( :b ) as ?list)
      ?member <http://franz.com/ns/allegrograph/4.11/sna/members> ?list .
    \}

Would return :x, :y, and :z.

## http://franz.com/ns/allegrograph/6.5.0/fn#makeSPARQLList

Associate the arguments with a blank node as a list and return it.

The blank node can be used with other functions and magic properties such as sna:members. For example:

    select ?member \{
      bind(<http://franz.com/ns/allegrograph/6.5.0/fn#makeSPARQLList>(1, 2, 3, 4) as ?list)
      ?member <http://franz.com/ns/allegrograph/4.11/sna/members> ?list .
    \}

Would return 1, 2, 3, and 4.)

## http://franz.com/ns/allegrograph/6.5.0/fn#makeSPARQLSet

Associate the arguments with a blank node as a set and return it.

The blank node can be used with other functions and magic properties such as sna:members. For example:

    select ?member \{
      bind(<http://franz.com/ns/allegrograph/6.5.0/fn#makeSPARQLSet>(1, 2, 4, 1, 2) as ?set)
      ?member <http://franz.com/ns/allegrograph/4.11/sna/members> ?set .
    \}

Would return 1, 2, and 4.)

### Notes

The following namespace abbreviations are used:

- fti - <http://franz.com/ns/allegrograph/2.2/textindex/>
- geo - <http://franz.com/ns/allegrograph/3.0/geospatial/>
- geofn - <http://franz.com/ns/allegrograph/3.0/geospatial/fn/>
- nd - <http://franz.com/ns/allegrograph/5.0/geo/nd#>
- ndfn - <http://franz.com/ns/allegrograph/5.0/geo/nd/fn#>
- sna - <http://franz.com/ns/allegrograph/4.11/sna/>

The SPARQL magic properties reference has additional information on using AllegroGraph magic properties and functions.