tiled

Tutorials

  • Installation
  • Navigate with the Python Client
  • Load Slices of Data
  • Deliberate Export
  • Log into an Authenticated Tiled Server
  • Serve a Directory of Files
  • Search
    • Search Using the Python Client
    • More Queries
  • Writing Data
  • Simple Tiled Server
  • Plot Data in Plotly Chart Studio

How To Guides

  • Python Client Authentication
  • Use Profiles to streamline Python client setup
  • Use Performance and Debug Logging
  • Run Tiled Server in a Container
  • Run Tiled Server from the Helm chart
  • Serve Data using Configuration Files
  • Serve Files with Custom Formats
  • Add Custom Export Formats
  • Create and Use API Keys
  • Custom Python Client Objects
  • Prometheus Metrics
  • Use Tiled in Python without an HTTP server
  • Set up a database for a scaled authenticated deloyment
  • Register Content in Tiled
  • Control Retries

Explanations

  • Architecture
  • Standards Used by Tiled
  • Structures
  • Metadata and “Specs”
  • Security
  • Compression
  • Case Study: Reading and Exporting a Specialized Format
  • Caches
  • Access Control
  • Catalog Database
  • FAQ
  • How Tiled Fits into the Ecosystem

Reference

  • Service-side Components
  • HTTP API
  • Python Client
  • Queries
  • Authentication Details
  • Scopes
  • Command-line tool
  • Service Configuration Reference
  • Client Profiles Reference
  • Release History
  • Minimum Version of Python and NumPy
tiled
  • Search
  • View page source

Search

In this tutorial we will find a dataset by performing a search over metadata.

To follow along, start the Tiled server with example data from a Terminal.

tiled serve demo

Search Using the Python Client

Now, in a Python interpreter, connect with the Python client.

from tiled.client import from_uri

client = from_uri("http://localhost:8000")

Tiled has an extensible collection of queries. The client just has to construct the query, and server sorts out how to execute it as efficiently as possible given however the metadata and data are stored.

This example collection of data has several entries with metadata.

>>> client['short_table'].metadata
DictView({'animal': 'dog', 'color': 'red'})

>>> client['long_table'].metadata
DictView({'animal': 'dog', 'color': 'green'})

>>> client['structured_data'].metadata
DictView({'animal': 'cat', 'color': 'green'})

# etc.

We’ll search among them for entries where the term "dog" appears anywhere in the metadata.

>>> from tiled.queries import FullText

>>> client.search(FullText("dog"))
<Container {'short_table', 'long_table', 'wide_table'}>

The result has a subset of the contents of the original. Searches may be chained to progressively narrow results:

>>> client.search(FullText("dog")).search(FullText("red"))
<Container {'short_table', 'wide_table'}>

If there no matches, the result is an empty Node:

>>> client.search(FullText("something that will not be found"))
<Container {}>

More Queries

Above examples use the FullText query. Tiled supports many queries; see Queries.

Previous Next

© Copyright 2021, Bluesky Collaboration.

Built with Sphinx using a theme provided by Read the Docs.