Summary
Service for retrieving/writing metadata from/to documents exposed on some reachable URL.
* When used for retrieval, the service extracts metadata from the document and returns them either as the RDF/XML format or as a JSON Object.
* When used for metadata update, the service writes metadata provided as a JSON Object into the document. It is currently possible to update metadata in OpenOffice documents only.
This Webservice is based on the open source library from Aperture
Retrieve metadata (GET) Format
analyze web page or file - send a GET request to: http://webnext.sfbay.sun.com/cqs/metadata with the following params: url = url of a file or or a web page to be analyzed format = rdf/json - requested metadata format in the response Parameter Parameter Value Description url url url of a file or a web page to be analyzed format rdf, json requested metadata format in the response
(* required parameters) Response
As a response, the service returns the metadata either in the RDF/XML or JSON format.
Subject of all the triples is the document itself. There are various predicates (=document properties) used in the response. Since all the triples have the subject in common, the response (in the JSON format) is actually a list of property-value pairs.
Majority of used predicates (properties) comes from the well-known vocabularies, like Dublin Core, or openoffice. Then there are some, which are specific to aperture(http://aperture.semanticdesktop.org). Please, use these respective resources for more information on the properties. There are different predicates returned for different mimetypes, but you should most of the time be able to get the usual ones like dc:title, dc:creator, or dc:subject.
We also had to introduce some additional properties, for which we have used the http://www.sun.com/ce2.0/metadata/ontology/data namespace. Our proprietary properties are:
* http://www.sun.com/ce2.0/metadata/ontology/data#mimeTypeSupported - true/false - says, whether the document mimeType you are trying to analyze is supported or not. * ...more to come.
JSON Example below shows the result of the analysis of the sun.com webpage (html mimetype) { "http://purl.org/dc/elements/1.1/description":"Sun Microsystems, Inc. develops innovative networking computing technologies to optimize your IT assets with energy-efficient servers, storage, open source software, tools, services and training.", "http://www.sun.com/ce2.0/metadata/ontology/data#mimeTypeSupported":"true", "http://aperture.semanticdesktop.org/ontology/data#keyword": \["computer","ray","hardware","solutions","desktop","technical","computing", "sun","network","training","critical","software","staroffice","performance", "availability","backup","systems","consulting","support","starportal", "sparc","microsystems","workgroup","enterprise","RAS","jini","workstation", "mission","scientific","service","compiler","solaris","cluster","jdk", "server","java","high","unix","storage"\], "http://aperture.semanticdesktop.org/ontology/data#mimeType":"text/html", "http://purl.org/dc/elements/1.1/title":"Sun Microsystems", "http://www.w3.org/1999/02/22-rdf-syntax-ns#about":"http://www.sun.com" } { "http://purl.org/dc/elements/1.1/description":"Sun Microsystems, Inc. develops innovative networking computing technologies to optimize your IT assets with energy-efficient servers, storage, open source software, tools, services and training.", "http://www.sun.com/ce2.0/metadata/ontology/data#mimeTypeSupported":"true", "http://aperture.semanticdesktop.org/ontology/data#keyword": \["computer","ray","hardware","solutions","desktop","technical","computing", "sun","network","training","critical","software","staroffice","performance", "availability","backup","systems","consulting","support","starportal", "sparc","microsystems","workgroup","enterprise","RAS","jini","workstation", "mission","scientific","service","compiler","solaris","cluster","jdk", "server","java","high","unix","storage"\], "http://aperture.semanticdesktop.org/ontology/data#mimeType":"text/html", "http://purl.org/dc/elements/1.1/title":"Sun Microsystems", "http://www.w3.org/1999/02/22-rdf-syntax-ns#about":"http://www.sun.com" } Errors Status Code Description 400 url parameter missing 400 format parameter missing 404 Error in the URL (URL) 404 Error creating the URL (URL) 500 Error extracting metadata from the file (URL) Update metadata (POST)
Note: Currently, it is possible to update metadata contained in the OpenOffice documents only. Input Format
update metadata in a file on some URL - send a POST request to the URL http://webnext.sfbay.sun.com/cqs/metadata with the following params:
* url - url of the file to be updated
* kwPolicy - keyword policy - append/replace - defines, whether the keywords (array in the 'http://aperture.semanticdesktop.org/ontology/data#keyword' property) should replace existing tags, or whether they should be appended to them.
* metadata - metadata you want to get written in the JSON format - the same, as you get in response on GET (see above). It is a JSON Object, which you can assign with the following properties:
o http://purl.org/dc/elements/1.1/title - document title - JSON String
o http://purl.org/dc/elements/1.1/description - document description - JSON String
o http://purl.org/dc/elements/1.1/subject - document subject - JSON String
o http://purl.org/dc/elements/1.1/creator - document creator - JSON String
o http://aperture.semanticdesktop.org/ontology/data#keyword - document tags - JSON Array of JSON Strings
o http://openoffice.org/2000/meta#user-defined - OpenOffice user-defined fields (there are 4) - JSON Array of JSON Objects. Each Object has the following 2 properties:
+ http://openoffice.org/2000/meta#name - name of the user-defined field - JSON String
+ http://openoffice.org/2000/meta#value - value of the user-defined field - JSON String
Input metadata example { "http://purl.org/dc/elements/1.1/description":"New Description Value", "http://purl.org/dc/elements/1.1/subject":"New Subject Value", "http://purl.org/dc/elements/1.1/title":"New Title Value", "http://purl.org/dc/elements/1.1/creator":"New Creator Value", "http://aperture.semanticdesktop.org/ontology/data#keyword": \["keyword1","keyword2","keyword3", "multi word keyword"\], "http://openoffice.org/2000/meta#user-defined": \[ {"http://openoffice.org/2000/meta#name":"UPD_Info 1", "http://openoffice.org/2000/meta#value":"UPD_user defined content 1"}, {"http://openoffice.org/2000/meta#name":"UPD_Info 2", "http://openoffice.org/2000/meta#value":"UPD_user defined content 2"}, {"http://openoffice.org/2000/meta#name":"UPD_Info 3", "http://openoffice.org/2000/meta#value":"UPD_user defined content 3"}, {"http://openoffice.org/2000/meta#name":"UPD_Info 4", "http://openoffice.org/2000/meta#value":"UPD_user defined content 4"} \] } { "http://purl.org/dc/elements/1.1/description":"New Description Value", "http://purl.org/dc/elements/1.1/subject":"New Subject Value", "http://purl.org/dc/elements/1.1/title":"New Title Value", "http://purl.org/dc/elements/1.1/creator":"New Creator Value", "http://aperture.semanticdesktop.org/ontology/data#keyword": \["keyword1","keyword2","keyword3", "multi word keyword"\], "http://openoffice.org/2000/meta#user-defined": \[ {"http://openoffice.org/2000/meta#name":"UPD_Info 1", "http://openoffice.org/2000/meta#value":"UPD_user defined content 1"}, {"http://openoffice.org/2000/meta#name":"UPD_Info 2", "http://openoffice.org/2000/meta#value":"UPD_user defined content 2"}, {"http://openoffice.org/2000/meta#name":"UPD_Info 3", "http://openoffice.org/2000/meta#value":"UPD_user defined content 3"}, {"http://openoffice.org/2000/meta#name":"UPD_Info 4", "http://openoffice.org/2000/meta#value":"UPD_user defined content 4"} \] } Parameter Parameter Value Description url* url URL to be analyzed (URL of a file, or a webpage) metadata* JSON Object - See the example above. metadata in a JSON format (generally subset of what you get in response on GET - it is possible to update only some properties (see above)) kwPolicy append,replace append/replace defines the keyword policy - whether keywords sent to the service should be appended to existing keywords, or whether they should replace them. Response
In the response, you will get back the document with updated metadata. Binary Stream. Errors Status Code Description 400 url parameter missing 400 format parameter missing 400 Error in the URL format (URL) 400 Not supported mimeType (mimeType) 500 Error while guessing the mimeType (mimeType) 500 Error parsing the input JSON metadata 500 Error updating the file metadata Base URL Environment Base URL Production https://webnext.sfbay.sun.com:8402/cqs/metadata Development https://webnext-dev.sfbay.sun.com:8402/cqs/metadata Edge Test https://ce20-webservice.sunsolutioncenter.de/cqs/metadata Examples
Test Page Environment Base URL Development https://webnext-dev.sfbay.sun.com:8402/cqs Edge Test https://ce20-webservice.sunsolutioncenter.de/cqs
Analyse an URL
* JSON Format
https://webnext.sfbay.sun.com/cqs/metadata?url=http%3A%2F%2Fwww.sun.com&format=JSON
* RDF Format
https://webnext.sfbay.sun.com/cqs/metadata?url=http%3A%2F%2Fwww.sun.com&format=RDF
Rate Limits
not applied Acceptable Use
TBD (To be defined). Support & Community
Send requests to ce20-support@sun.com For More Information
* Metadata analysys is included to pim, see details here http://sls-bugs.central.sun.com/browse/CE-164





