Skip to content

# `` prepared_query

SPARQL Queries be prepared (i.e parsed and translated to SPARQL algebra) by the `prepareQuery` method.

`initNs` can be used instead of PREFIX values.

When executing, variables can be bound with the `initBindings` keyword parameter.

Attributes:

- `EXAMPLES_DIR` –
- `g` –
- `q` –
- `tim` –

## `` EXAMPLES_DIR `module-attribute`

    EXAMPLES_DIR = parent

## `` g `module-attribute`

    g = Graph()

## `` q `module-attribute`

    q = prepareQuery('SELECT ?name WHERE { ?person foaf:knows/foaf:name ?name . }', initNs={'foaf': FOAF})

## `` tim `module-attribute`

    tim = URIRef('http://www.w3.org/People/Berners-Lee/card#i')