Help Center » Developing Applications » The Complete Metaweb Query Language (MQL) Reference Guide

The Complete Metaweb Query Language (MQL) Reference Guide

1. Introduction
1.1. The Metaweb Query API
1.2. About this Manual
2. Metaweb Architecture
2.1. The Metaweb Object Model
2.1.1. Common Object Properties
2.1.2. Names, Keys, and Ids
2.1.3. Topics
2.2. Values
2.2.1. /type/int
2.2.2. /type/float
2.2.3. /type/boolean
2.2.4. /type/id
2.2.5. /type/text
2.2.6. /type/key
2.2.7. /type/rawstring
2.2.8. /type/uri
2.2.9. /type/datetime
2.3. Types
2.3.1. Core Types
2.3.2. Content Types
2.3.3. Access Control Types
2.4. Domains
2.5. Namespaces
2.6. Access Control
3. The Metaweb Query Language
3.1. JavaScript Object Notation
3.1.1. JSON Literals: null, true, false
3.1.2. JSON Numbers
3.1.3. JSON Strings
3.1.4. JSON Arrays
3.1.5. JSON Objects
3.2. MQL Tutorial
3.2.1. Our First Query
3.2.2. Query/Response Symmetry
3.2.3. Metaweb Object IDs
3.2.4. Multiple Results and Uniqueness Errors
3.2.5. Nested Queries
3.2.6. Asking Metaweb For Objects
3.2.7. Expanded Values and Default Properties
3.2.8. Review: Asking for Values
3.2.9. Too Much Information
3.2.10. The id and name Properties
3.2.11. Numeric Constraints
3.2.12. Textual Constraints: Pattern Matching in Queries
3.2.13. Limiting Queries
3.2.14. The Sort Directive
3.2.15. Ordered Collections
3.2.16. Optional Queries
3.2.17. Using Fully-Qualified Property Names
3.2.18. Wildcards
3.2.19. Expressing AND in Queries
3.2.20. Expressing OR in Queries
3.2.21. Expressing NOT in Queries
3.2.22. Reflective Queries
3.3. The MQL Grammar
4. Metaweb Read Services
4.1. Basic mqlread Queries with Perl
4.1.1. A Better Perl Album Lister
4.2. The mqlread Service
4.2.1. mqlread Input
4.2.2. mqlread Output
4.2.3. Query and Response Envelopes
4.3. A Python Album Lister
4.4. A Metaweb-enabled PHP Web Application
4.5. Metaweb Queries with JavaScript
4.5.1. Listing Albums and Tracks with JavaScript
4.5.2. Client-side MQL Queries with
4.6. mqlread Errors
4.7. mqlread Cursors
4.8. Fetching Content with trans
4.8.1. Browsing Recent Content on freebase.com
4.9. Example: A Metaweb Type Browser
5. The MQL Write Grammar
5.1. MQL Write Tutorial
5.1.1. Creating a Type to Work With
5.1.2. Creating Objects
5.1.3. Connecting Objects
5.1.4. Disconnecting Objects
5.1.5. Writes and Default Properties
5.1.6. Creating and Connecting More Objects
5.1.7. Review: Write Directives
5.1.8. Working with Sets
5.1.9. Bidirectional Links and Reciprocal Properties
5.1.10. Writes and Ordered Collections
5.1.11. Namespaces
5.1.12. Properties, Types, and Domains
5.2. MQL Write Grammar
6. Metaweb Write Services
6.1. Logging in to Metaweb
6.1.1. The Login API
6.2. Making Write Queries
6.2.1. The mqlwrite Query Envelope
6.2.2. The Response Envelope
6.2.3. A mqlwrite Utility Function
6.2.4. Example: US State Quarters
6.2.5. Sending Multiple Queries to mqlwrite
6.3. Uploading Data to Metaweb
6.3.1. An Upload Utility
6.3.2. Examples: Uploading Images of State Quarters
6.3.3. Uploading Documents
6.4. Example: Unlinking Objects
A. Additional Code
A.1. json.js
A.2. Client-side MQL Queries through a Proxy
A.3. Example: Auto-completion with mqlread

B. metaweb.py Module

List of Examples

3.1. qedit.html: Code for a Metaweb query editor
4.1. albumlist.pl: submitting MQL queries in Perl
4.2. albumlist2.pl: a better Perl album lister
4.3. metaweb.py: using mqlread with Python
4.4. albumlist.py: listing albums in Python
4.5. metaweb.php: using mqlread with PHP
4.6. albumlist.php: A Metaweb-enabled web application in PHP
4.7. albumlist.html: a JavaScript album and track lister
4.8. metaweb.js: Metaweb queries with script tags
4.9. metaweb.py: querying Metaweb with a cursor, in Python
4.10. WhatsNew.html: fetching new images and documents from freebase.com
4.11. TypeBrowser.html: a Metaweb type browser
6.1. metaweb.py: logging in to Metaweb with Python
6.2. metaweb.py: sending a query to mqlwrite
6.3. quarters.py: writing a data set to Metaweb
6.4. metaweb.py: uploading content to Metaweb
6.5. quarterpix.py: uploading images to Metaweb
6.6. uploaddoc.py: uploading HTML documents to Metaweb
6.7. unlink.py: unlinking Metaweb objects
A.1. json.js: JSON parsing and serialization in JavaScript
A.2. metaweb_proxy.js: Metaweb queries through a proxy
A.3. mqlread.php: a trivial mqlread proxy in PHP
A.4. completiontest.html: using Metaweb.addValidationAndCompletion()
A.5. validateAndComplete.js: form validation and completion with mqlread

Recent Discussions about The Complete Metaweb Query Language (MQL) Reference Guide

Can someone please fix the typography and layout of this page

"This is a problem caused by an update in the CSS used to layout the page, and some faulty mark-up..."

3 posts

c# example

"Hey there, sorry it took so long, I was on vacation when you posted this. I've added the code to..."

3 posts

* doesn't appear to process a single word as stated

"Hey Maccaday, I found something in the new, updated version of the MQL manual that we'll be..."

6 posts

Limit and offset

"Sorry; the cursor needs to go in the query envelope, not the query itself. See ยง4.7 of the API..."

5 posts

bidirectional links

"All links are truly bidirectional. The client may not show them, but that is not the same thing...."

2 posts
Join the Discussion »