Semantic.query
This is a prototype for Safe Creative semantic services.
It allows to query a work registration info by providing some kind of digital fingerprint
Syntax
This component uses a different syntax from the rest of the API:
http://api-search.safecreative.org/semantic-query?param=value&....
Parameters
You can use any of the following parameters on your semantic queries:
- adler32: Adler32 checksum of file contents (16 hex digits- first 8 digits should be zero)
- crc32: CRC32 checksum of file contents (16 hex digits – first 8 digits should be zero)
- ed2kfileid: File hash for ed2k network (32 hex digits)
- md2: MD2 hash of file contents (32 hex digits)
- md4: MD4 hash of file contents (32 hex digits)
- md5: MD5 hash of file contents (32 hex digits)
- part32k.first: SHA1 hash of the first 32k of file contents (40 hex digits)
- part32k.last: SHA1 hash of the last 32k of file contents (40 hex digits)
- part32k.middle: SHA1 hash of middle 32k of file contents (40 hex digits)
- It is calculated as the SHA1 of a 32k chunk starting on file position (filesize – 32k) / 2.
- If the file size is less than 32k, it is the hash of the whole file.
- sha: SHA1 hash of file contents(40 hex digits)
- sha1: SHA1 hash of file contents (40 hex digits)
- sha384: SHA384 hash of file contents (96 hex digits)
- sha512: SHA512 hash of file contents (128 hex digits)
- size: File size in bytes
- torrent.*: SHA1 hash of torrent chunk hashes for different chunk sizes (40 hex digits)
- torrent.32768: 32k chunks
- torrent.49152: 48k chunks
- torrent.65536: 64k chunks
- torrent.98304: 96k chunks
- torrent.131072: 128k chunks
- torrent.196608: 192k chunks
- torrent.262144: 256k chunks
- torrent.393216: 384k chunks
- torrent.524288: 512k chunks
- torrent.786432: 768k chunks
- torrent.1048576: 1024k chunks
- torrent.1572864: 1536k chunks
- torrent.2097152: 2048k chunks
- torrent.3145728: 3072k chunks
- torrent.4194304: 4096k chunks
All binary contents must be encoded as a string of hexadecimal lowercase digits (0123456789abcdef), using two digits per byte (e.g. 8 bytes = 16 hex digits).
Returns
- works
- work
- code: Safe Creative work code
- title: Work title
- authors: List of authors
- author
- code: Author's Safe Creative user code
- name: Author's full name
- human-url: URL to the author's Safe Creative public profile
- author
- rights-holders: List of rights holders
- rights-holder
- code: Rights holder's Safe Creative user code
- name: Rights holder's full name
- human-url: URL to the rights holder's Safe Creative public profile
- rights-holder
- thumbnail: URL to the work thumbnail (if any)
- license: Work license
- code: License code
- name: License name
- shortname: License short name
- human-url: URL to license text
- features: License features (see user.licenses
- human-url: URL to this work web page in Safe Creative
- machine-url: URL to this work API info response (see work.get)*
- work
Example
REQUEST:
http://api-search.safecreative.org/semantic-query?md5=9a4bca4293523413c176dd6cd23d20c2
RESPONSE:
<?xml version="1.0" encoding="UTF-8"?> <works> <work> <code>0908044196577</code> <title>atardecer plateado</title> <authors> <author> <code>0709270000528</code> <name>Mario Pena Zapatería</name> <human-url>http://www.safecreative.org/user/0709270000528</human-url> </author> </authors> <thumbnail>http://thumbnails-safecreative-org.s3.amazonaws.com/1/00000122/e579/ca7e/dc6a/a75443e756ad/atardecerplateado_thumb.png</thumbnail> <license> <code>http://creativecommons.org/licenses/by-sa/3.0/</code> <name>Creative Commons Reconocimiento-Compartirigual 3.0</name> <shortname>CC by-sa</shortname> <human-url>http://creativecommons.org/licenses/by-sa/3.0/legalcode</human-url> <features> <recognition>YES</recognition> <distribution>YES</distribution> <derivations>INHERITANCE</derivations> <commercial>YES</commercial> </features> </license> <human-url>http://www.safecreative.org/work/0908044196577</human-url> <machine-url>http://www.safecreative.org/v2/?component=work.get&code=0908044196577</machine-url> </work> </works>