{ "metadata": { "name": "Untitled0" }, "nbformat": 3, "nbformat_minor": 0, "worksheets": [ { "cells": [ { "cell_type": "markdown", "metadata": {}, "source": "Instalar\n========\nS\u00f3lo hace falta instalar pyld: https://github.com/digitalbazaar/pyld\n\n```bash\npip install pyld \n```\n\nTambi\u00e9n puedes instalar rdflib para convertir el fichero de xml-rdf a nt.\n\nModificar el frame\n==================\nLo que metas dentro del frame se usa para dos cosas:\n * La parte del contexto se usa para compactizar (reducir nombres, son los prefijos)\n * El total se usa para dar estructura al json final\n \nPor tanto, aqu\u00ed puedes decirle qu\u00e9 espacios de nombres y qu\u00e9 campos usar.\nComo ver\u00e1s, adem\u00e1s de hacer framing hago compact.\n\u00bfPor qu\u00e9?, pues porque el framing deja una lista de objetos colgando de \"@graph\", y si esa lista tiene un s\u00f3lo elemento podemos pasar esos atributos a la \"ra\u00edz\" para hacer m\u00e1s legible el json.\n\nEjemplo\n-------\n```json\n{ ...\n \"@graph\": [ {\"@id\": \"test\", \"name\": \"testing\"}]\n}\n```\n\nSe convierte en:\n\n```json\n{ ...\n \"@id\": \"test\",\n \"name\": \"testing\"\n\n}\n```\n\n\nSin l\u00edos\n========\n\nPuedes usar el json-ld playground para estas cosas: [Enlace](http://json-ld.org/playground/index.html#startTab=tab-framed&json-ld=%7B%22%40context%22%3A%7B%22foaf%22%3A%22http%3A%2F%2Fxmlns.com%2Ffoaf%2F0.1%2F%22%2C%22owl%22%3A%22http%3A%2F%2Fwww.w3.org%2F2002%2F07%2Fowl%23%22%2C%22rdfs%22%3A%22http%3A%2F%2Fwww.w3.org%2F2000%2F01%2Frdf-schema%23%22%2C%22image%22%3A%7B%22%40id%22%3A%22http%3A%2F%2Fschema.org%2Fimage%22%2C%22%40type%22%3A%22%40id%22%7D%2C%22tags%22%3A%22http%3A%2F%2Fwww.holygoat.co.uk%2Fowl%2Fredwood%2F0.1%2Ftags%2F%22%2C%22ewe%22%3A%22http%3A%2F%2Fgsi.dit.upm.es%2Fontologies%2Fewe%2Fns%2F%22%2C%22rdf%22%3A%22http%3A%2F%2Fwww.w3.org%2F1999%2F02%2F22-rdf-syntax-ns%23%22%2C%22xsd%22%3A%22http%3A%2F%2Fwww.w3.org%2F2001%2FXMLSchema%23%22%2C%22dcterms%22%3A%22http%3A%2F%2Fpurl.org%2Fdc%2Fterms%2F%22%2C%22homepage%22%3A%7B%22%40id%22%3A%22http%3A%2F%2Fschema.org%2Furl%22%2C%22%40type%22%3A%22%40id%22%7D%2C%22spinrdf%22%3A%22http%3A%2F%2Fspinrdf.org%2Fsp%23%22%7D%2C%22%40graph%22%3A%5B%7B%22%40id%22%3A%22_%3Ab0%22%2C%22spinrdf%3AvarName%22%3A%22message%22%7D%2C%7B%22%40id%22%3A%22_%3Ab1%22%2C%22spinrdf%3AvarName%22%3A%22action%22%7D%2C%7B%22spinrdf%3Atemplates%22%3A%7B%22%40list%22%3A%5B%7B%22spinrdf%3Apredicate%22%3A%7B%22%40id%22%3A%22rdf%3Atype%22%7D%2C%22spinrdf%3Aobject%22%3A%7B%22%40id%22%3A%22http%3A%2F%2Fgsi.dit.upm.es%2Fontologies%2Fewe%23Action%22%7D%2C%22%40id%22%3A%22_%3Ab11%22%2C%22spinrdf%3Asubject%22%3A%7B%22%40id%22%3A%22_%3Ab38%22%2C%22spinrdf%3AvarName%22%3A%22action%22%7D%7D%2C%7B%22spinrdf%3Apredicate%22%3A%7B%22%40id%22%3A%22dcterms%3Atitle%22%7D%2C%22spinrdf%3Aobject%22%3A%22New%20chat%20message%22%2C%22%40id%22%3A%22_%3Ab12%22%2C%22spinrdf%3Asubject%22%3A%7B%22%40id%22%3A%22_%3Ab23%22%2C%22spinrdf%3AvarName%22%3A%22action%22%7D%7D%2C%7B%22spinrdf%3Apredicate%22%3A%7B%22%40id%22%3A%22http%3A%2F%2Fgsi.dit.upm.es%2Fontologies%2Fewe%23hasParameter%22%7D%2C%22spinrdf%3Aobject%22%3A%7B%22%40id%22%3A%22_%3Ab37%22%2C%22spinrdf%3AvarName%22%3A%22iParam%22%7D%2C%22%40id%22%3A%22_%3Ab13%22%2C%22spinrdf%3Asubject%22%3A%7B%22%40id%22%3A%22_%3Ab32%22%2C%22spinrdf%3AvarName%22%3A%22action%22%7D%7D%2C%7B%22spinrdf%3Apredicate%22%3A%7B%22%40id%22%3A%22dcterms%3Atitle%22%7D%2C%22spinrdf%3Aobject%22%3A%22message%22%2C%22%40id%22%3A%22_%3Ab7%22%2C%22spinrdf%3Asubject%22%3A%7B%22%40id%22%3A%22_%3Ab8%22%2C%22spinrdf%3AvarName%22%3A%22iParam%22%7D%7D%2C%7B%22spinrdf%3Apredicate%22%3A%7B%22%40id%22%3A%22dcterms%3Avalue%22%7D%2C%22spinrdf%3Aobject%22%3A%7B%22%40id%22%3A%22_%3Ab0%22%2C%22spinrdf%3AvarName%22%3A%22message%22%7D%2C%22%40id%22%3A%22_%3Ab2%22%2C%22spinrdf%3Asubject%22%3A%7B%22%40id%22%3A%22_%3Ab3%22%2C%22spinrdf%3AvarName%22%3A%22iParam%22%7D%7D%2C%7B%22spinrdf%3Apredicate%22%3A%7B%22%40id%22%3A%22http%3A%2F%2Fgsi.dit.upm.es%2Fontologies%2Fewe%23providesAction%22%7D%2C%22spinrdf%3Aobject%22%3A%7B%22%40id%22%3A%22_%3Ab5%22%2C%22spinrdf%3AvarName%22%3A%22action%22%7D%2C%22%40id%22%3A%22_%3Ab4%22%2C%22spinrdf%3Asubject%22%3A%7B%22%40id%22%3A%22https%3A%2F%2Fifttt.com%2FGoogleTalk%22%7D%7D%5D%7D%2C%22%40id%22%3A%22_%3Ab10%22%2C%22%40type%22%3A%22spinrdf%3AConstruct%22%2C%22spinrdf%3Awhere%22%3A%7B%22%40list%22%3A%5B%7B%22spinrdf%3Apredicate%22%3A%7B%22%40id%22%3A%22rdf%3Atype%22%7D%2C%22spinrdf%3Aobject%22%3A%7B%22%40id%22%3A%22http%3A%2F%2Fgsi.dit.upm.es%2Fontologies%2Fewe%23Event%22%7D%2C%22%40id%22%3A%22_%3Ab14%22%2C%22spinrdf%3Asubject%22%3A%7B%22%40id%22%3A%22_%3Ab36%22%2C%22spinrdf%3AvarName%22%3A%22event%22%7D%7D%2C%7B%22spinrdf%3Apredicate%22%3A%7B%22%40id%22%3A%22dcterms%3Atitle%22%7D%2C%22spinrdf%3Aobject%22%3A%22Any%20new%20email%22%2C%22%40id%22%3A%22_%3Ab15%22%2C%22spinrdf%3Asubject%22%3A%7B%22%40id%22%3A%22_%3Ab27%22%2C%22spinrdf%3AvarName%22%3A%22event%22%7D%7D%2C%7B%22spinrdf%3Apredicate%22%3A%7B%22%40id%22%3A%22http%3A%2F%2Fgsi.dit.upm.es%2Fontologies%2Fewe%23hasOutputParameter%22%7D%2C%22spinrdf%3Aobject%22%3A%7B%22%40id%22%3A%22_%3Ab35%22%2C%22spinrdf%3AvarName%22%3A%22oParam%22%7D%2C%22%40id%22%3A%22_%3Ab16%22%2C%22spinrdf%3Asubject%22%3A%7B%22%40id%22%3A%22_%3Ab33%22%2C%22spinrdf%3AvarName%22%3A%22event%22%7D%7D%2C%7B%22spinrdf%3Apredicate%22%3A%7B%22%40id%22%3A%22http%3A%2F%2Fgsi.dit.upm.es%2Fontologies%2Fewe%23generatesEvent%22%7D%2C%22spinrdf%3Aobject%22%3A%7B%22%40id%22%3A%22_%3Ab6%22%2C%22spinrdf%3AvarName%22%3A%22event%22%7D%2C%22%40id%22%3A%22_%3Ab17%22%2C%22spinrdf%3Asubject%22%3A%7B%22%40id%22%3A%22https%3A%2F%2Fifttt.com%2FGmail%22%7D%7D%2C%7B%22spinrdf%3Apredicate%22%3A%7B%22%40id%22%3A%22dcterms%3Atitle%22%7D%2C%22spinrdf%3Aobject%22%3A%22FromAddress%22%2C%22%40id%22%3A%22_%3Ab18%22%2C%22spinrdf%3Asubject%22%3A%7B%22%40id%22%3A%22_%3Ab24%22%2C%22spinrdf%3AvarName%22%3A%22oParam%22%7D%7D%2C%7B%22spinrdf%3Apredicate%22%3A%7B%22%40id%22%3A%22dcterms%3Avalue%22%7D%2C%22spinrdf%3Aobject%22%3A%7B%22%40id%22%3A%22_%3Ab31%22%2C%22spinrdf%3AvarName%22%3A%22oParamFrom%22%7D%2C%22%40id%22%3A%22_%3Ab19%22%2C%22spinrdf%3Asubject%22%3A%7B%22%40id%22%3A%22_%3Ab9%22%2C%22spinrdf%3AvarName%22%3A%22oParam%22%7D%7D%2C%7B%22%40id%22%3A%22_%3Ab20%22%2C%22%40type%22%3A%22spinrdf%3ABind%22%2C%22spinrdf%3Aexpression%22%3A%7B%22spinrdf%3Aarg2%22%3A%7B%22%40id%22%3A%22_%3Ab29%22%2C%22spinrdf%3AvarName%22%3A%22oParamFrom%22%7D%2C%22spinrdf%3Aarg1%22%3A%22You%20have%20received%20a%20new%20message%20from%20%22%2C%22%40id%22%3A%22_%3Ab28%22%2C%22%40type%22%3A%22http%3A%2F%2Fwww.w3.org%2F2005%2Fxpath-functions%23concat%22%7D%2C%22spinrdf%3Avariable%22%3A%7B%22%40id%22%3A%22_%3Ab30%22%2C%22spinrdf%3AvarName%22%3A%22message%22%7D%7D%2C%7B%22%40id%22%3A%22_%3Ab21%22%2C%22%40type%22%3A%22spinrdf%3ABind%22%2C%22spinrdf%3Aexpression%22%3A%7B%22spinrdf%3Aarg1%22%3A%22http%3A%2F%2Fgsi.dit.upm.es%2Fontology%2Fewe%2Feamples%2Faction1%22%2C%22%40id%22%3A%22_%3Ab34%22%2C%22%40type%22%3A%22spinrdf%3Auri%22%7D%2C%22spinrdf%3Avariable%22%3A%7B%22%40id%22%3A%22_%3Ab1%22%2C%22spinrdf%3AvarName%22%3A%22action%22%7D%7D%2C%7B%22%40id%22%3A%22_%3Ab22%22%2C%22%40type%22%3A%22spinrdf%3ABind%22%2C%22spinrdf%3Aexpression%22%3A%7B%22spinrdf%3Aarg1%22%3A%22http%3A%2F%2Fgsi.dit.upm.es%2Fontology%2Fewe%2Feamples%2Fparam1%22%2C%22%40id%22%3A%22_%3Ab25%22%2C%22%40type%22%3A%22spinrdf%3Auri%22%7D%2C%22spinrdf%3Avariable%22%3A%7B%22%40id%22%3A%22_%3Ab26%22%2C%22spinrdf%3AvarName%22%3A%22iParam%22%7D%7D%5D%7D%7D%2C%7B%22spinrdf%3Apredicate%22%3A%7B%22%40id%22%3A%22rdf%3Atype%22%7D%2C%22spinrdf%3Aobject%22%3A%7B%22%40id%22%3A%22http%3A%2F%2Fgsi.dit.upm.es%2Fontologies%2Fewe%23Action%22%7D%2C%22%40id%22%3A%22_%3Ab11%22%2C%22spinrdf%3Asubject%22%3A%7B%22%40id%22%3A%22_%3Ab38%22%2C%22spinrdf%3AvarName%22%3A%22action%22%7D%7D%2C%7B%22spinrdf%3Apredicate%22%3A%7B%22%40id%22%3A%22dcterms%3Atitle%22%7D%2C%22spinrdf%3Aobject%22%3A%22New%20chat%20message%22%2C%22%40id%22%3A%22_%3Ab12%22%2C%22spinrdf%3Asubject%22%3A%7B%22%40id%22%3A%22_%3Ab23%22%2C%22spinrdf%3AvarName%22%3A%22action%22%7D%7D%2C%7B%22spinrdf%3Apredicate%22%3A%7B%22%40id%22%3A%22http%3A%2F%2Fgsi.dit.upm.es%2Fontologies%2Fewe%23hasParameter%22%7D%2C%22spinrdf%3Aobject%22%3A%7B%22%40id%22%3A%22_%3Ab37%22%2C%22spinrdf%3AvarName%22%3A%22iParam%22%7D%2C%22%40id%22%3A%22_%3Ab13%22%2C%22spinrdf%3Asubject%22%3A%7B%22%40id%22%3A%22_%3Ab32%22%2C%22spinrdf%3AvarName%22%3A%22action%22%7D%7D%2C%7B%22spinrdf%3Apredicate%22%3A%7B%22%40id%22%3A%22rdf%3Atype%22%7D%2C%22spinrdf%3Aobject%22%3A%7B%22%40id%22%3A%22http%3A%2F%2Fgsi.dit.upm.es%2Fontologies%2Fewe%23Event%22%7D%2C%22%40id%22%3A%22_%3Ab14%22%2C%22spinrdf%3Asubject%22%3A%7B%22%40id%22%3A%22_%3Ab36%22%2C%22spinrdf%3AvarName%22%3A%22event%22%7D%7D%2C%7B%22spinrdf%3Apredicate%22%3A%7B%22%40id%22%3A%22dcterms%3Atitle%22%7D%2C%22spinrdf%3Aobject%22%3A%22Any%20new%20email%22%2C%22%40id%22%3A%22_%3Ab15%22%2C%22spinrdf%3Asubject%22%3A%7B%22%40id%22%3A%22_%3Ab27%22%2C%22spinrdf%3AvarName%22%3A%22event%22%7D%7D%2C%7B%22spinrdf%3Apredicate%22%3A%7B%22%40id%22%3A%22http%3A%2F%2Fgsi.dit.upm.es%2Fontologies%2Fewe%23hasOutputParameter%22%7D%2C%22spinrdf%3Aobject%22%3A%7B%22%40id%22%3A%22_%3Ab35%22%2C%22spinrdf%3AvarName%22%3A%22oParam%22%7D%2C%22%40id%22%3A%22_%3Ab16%22%2C%22spinrdf%3Asubject%22%3A%7B%22%40id%22%3A%22_%3Ab33%22%2C%22spinrdf%3AvarName%22%3A%22event%22%7D%7D%2C%7B%22spinrdf%3Apredicate%22%3A%7B%22%40id%22%3A%22http%3A%2F%2Fgsi.dit.upm.es%2Fontologies%2Fewe%23generatesEvent%22%7D%2C%22spinrdf%3Aobject%22%3A%7B%22%40id%22%3A%22_%3Ab6%22%2C%22spinrdf%3AvarName%22%3A%22event%22%7D%2C%22%40id%22%3A%22_%3Ab17%22%2C%22spinrdf%3Asubject%22%3A%7B%22%40id%22%3A%22https%3A%2F%2Fifttt.com%2FGmail%22%7D%7D%2C%7B%22spinrdf%3Apredicate%22%3A%7B%22%40id%22%3A%22dcterms%3Atitle%22%7D%2C%22spinrdf%3Aobject%22%3A%22FromAddress%22%2C%22%40id%22%3A%22_%3Ab18%22%2C%22spinrdf%3Asubject%22%3A%7B%22%40id%22%3A%22_%3Ab24%22%2C%22spinrdf%3AvarName%22%3A%22oParam%22%7D%7D%2C%7B%22spinrdf%3Apredicate%22%3A%7B%22%40id%22%3A%22dcterms%3Avalue%22%7D%2C%22spinrdf%3Aobject%22%3A%7B%22%40id%22%3A%22_%3Ab31%22%2C%22spinrdf%3AvarName%22%3A%22oParamFrom%22%7D%2C%22%40id%22%3A%22_%3Ab19%22%2C%22spinrdf%3Asubject%22%3A%7B%22%40id%22%3A%22_%3Ab9%22%2C%22spinrdf%3AvarName%22%3A%22oParam%22%7D%7D%2C%7B%22spinrdf%3Apredicate%22%3A%7B%22%40id%22%3A%22dcterms%3Avalue%22%7D%2C%22spinrdf%3Aobject%22%3A%7B%22%40id%22%3A%22_%3Ab0%22%2C%22spinrdf%3AvarName%22%3A%22message%22%7D%2C%22%40id%22%3A%22_%3Ab2%22%2C%22spinrdf%3Asubject%22%3A%7B%22%40id%22%3A%22_%3Ab3%22%2C%22spinrdf%3AvarName%22%3A%22iParam%22%7D%7D%2C%7B%22%40id%22%3A%22_%3Ab20%22%2C%22%40type%22%3A%22spinrdf%3ABind%22%2C%22spinrdf%3Aexpression%22%3A%7B%22spinrdf%3Aarg2%22%3A%7B%22%40id%22%3A%22_%3Ab29%22%2C%22spinrdf%3AvarName%22%3A%22oParamFrom%22%7D%2C%22spinrdf%3Aarg1%22%3A%22You%20have%20received%20a%20new%20message%20from%20%22%2C%22%40id%22%3A%22_%3Ab28%22%2C%22%40type%22%3A%22http%3A%2F%2Fwww.w3.org%2F2005%2Fxpath-functions%23concat%22%7D%2C%22spinrdf%3Avariable%22%3A%7B%22%40id%22%3A%22_%3Ab30%22%2C%22spinrdf%3AvarName%22%3A%22message%22%7D%7D%2C%7B%22%40id%22%3A%22_%3Ab21%22%2C%22%40type%22%3A%22spinrdf%3ABind%22%2C%22spinrdf%3Aexpression%22%3A%7B%22spinrdf%3Aarg1%22%3A%22http%3A%2F%2Fgsi.dit.upm.es%2Fontology%2Fewe%2Feamples%2Faction1%22%2C%22%40id%22%3A%22_%3Ab34%22%2C%22%40type%22%3A%22spinrdf%3Auri%22%7D%2C%22spinrdf%3Avariable%22%3A%7B%22%40id%22%3A%22_%3Ab1%22%2C%22spinrdf%3AvarName%22%3A%22action%22%7D%7D%2C%7B%22%40id%22%3A%22_%3Ab22%22%2C%22%40type%22%3A%22spinrdf%3ABind%22%2C%22spinrdf%3Aexpression%22%3A%7B%22spinrdf%3Aarg1%22%3A%22http%3A%2F%2Fgsi.dit.upm.es%2Fontology%2Fewe%2Feamples%2Fparam1%22%2C%22%40id%22%3A%22_%3Ab25%22%2C%22%40type%22%3A%22spinrdf%3Auri%22%7D%2C%22spinrdf%3Avariable%22%3A%7B%22%40id%22%3A%22_%3Ab26%22%2C%22spinrdf%3AvarName%22%3A%22iParam%22%7D%7D%2C%7B%22%40id%22%3A%22_%3Ab23%22%2C%22spinrdf%3AvarName%22%3A%22action%22%7D%2C%7B%22%40id%22%3A%22_%3Ab24%22%2C%22spinrdf%3AvarName%22%3A%22oParam%22%7D%2C%7B%22spinrdf%3Aarg1%22%3A%22http%3A%2F%2Fgsi.dit.upm.es%2Fontology%2Fewe%2Feamples%2Fparam1%22%2C%22%40id%22%3A%22_%3Ab25%22%2C%22%40type%22%3A%22spinrdf%3Auri%22%7D%2C%7B%22%40id%22%3A%22_%3Ab26%22%2C%22spinrdf%3AvarName%22%3A%22iParam%22%7D%2C%7B%22%40id%22%3A%22_%3Ab27%22%2C%22spinrdf%3AvarName%22%3A%22event%22%7D%2C%7B%22spinrdf%3Aarg2%22%3A%7B%22%40id%22%3A%22_%3Ab29%22%2C%22spinrdf%3AvarName%22%3A%22oParamFrom%22%7D%2C%22spinrdf%3Aarg1%22%3A%22You%20have%20received%20a%20new%20message%20from%20%22%2C%22%40id%22%3A%22_%3Ab28%22%2C%22%40type%22%3A%22http%3A%2F%2Fwww.w3.org%2F2005%2Fxpath-functions%23concat%22%7D%2C%7B%22%40id%22%3A%22_%3Ab29%22%2C%22spinrdf%3AvarName%22%3A%22oParamFrom%22%7D%2C%7B%22%40id%22%3A%22_%3Ab3%22%2C%22spinrdf%3AvarName%22%3A%22iParam%22%7D%2C%7B%22%40id%22%3A%22_%3Ab30%22%2C%22spinrdf%3AvarName%22%3A%22message%22%7D%2C%7B%22%40id%22%3A%22_%3Ab31%22%2C%22spinrdf%3AvarName%22%3A%22oParamFrom%22%7D%2C%7B%22%40id%22%3A%22_%3Ab32%22%2C%22spinrdf%3AvarName%22%3A%22action%22%7D%2C%7B%22%40id%22%3A%22_%3Ab33%22%2C%22spinrdf%3AvarName%22%3A%22event%22%7D%2C%7B%22spinrdf%3Aarg1%22%3A%22http%3A%2F%2Fgsi.dit.upm.es%2Fontology%2Fewe%2Feamples%2Faction1%22%2C%22%40id%22%3A%22_%3Ab34%22%2C%22%40type%22%3A%22spinrdf%3Auri%22%7D%2C%7B%22%40id%22%3A%22_%3Ab35%22%2C%22spinrdf%3AvarName%22%3A%22oParam%22%7D%2C%7B%22%40id%22%3A%22_%3Ab36%22%2C%22spinrdf%3AvarName%22%3A%22event%22%7D%2C%7B%22%40id%22%3A%22_%3Ab37%22%2C%22spinrdf%3AvarName%22%3A%22iParam%22%7D%2C%7B%22%40id%22%3A%22_%3Ab38%22%2C%22spinrdf%3AvarName%22%3A%22action%22%7D%2C%7B%22spinrdf%3Apredicate%22%3A%7B%22%40id%22%3A%22http%3A%2F%2Fgsi.dit.upm.es%2Fontologies%2Fewe%23providesAction%22%7D%2C%22spinrdf%3Aobject%22%3A%7B%22%40id%22%3A%22_%3Ab5%22%2C%22spinrdf%3AvarName%22%3A%22action%22%7D%2C%22%40id%22%3A%22_%3Ab4%22%2C%22spinrdf%3Asubject%22%3A%7B%22%40id%22%3A%22https%3A%2F%2Fifttt.com%2FGoogleTalk%22%7D%7D%2C%7B%22%40id%22%3A%22_%3Ab5%22%2C%22spinrdf%3AvarName%22%3A%22action%22%7D%2C%7B%22%40id%22%3A%22_%3Ab6%22%2C%22spinrdf%3AvarName%22%3A%22event%22%7D%2C%7B%22spinrdf%3Apredicate%22%3A%7B%22%40id%22%3A%22dcterms%3Atitle%22%7D%2C%22spinrdf%3Aobject%22%3A%22message%22%2C%22%40id%22%3A%22_%3Ab7%22%2C%22spinrdf%3Asubject%22%3A%7B%22%40id%22%3A%22_%3Ab8%22%2C%22spinrdf%3AvarName%22%3A%22iParam%22%7D%7D%2C%7B%22%40id%22%3A%22_%3Ab8%22%2C%22spinrdf%3AvarName%22%3A%22iParam%22%7D%2C%7B%22%40id%22%3A%22_%3Ab9%22%2C%22spinrdf%3AvarName%22%3A%22oParam%22%7D%2C%7B%22ewe%3Aexecutes%22%3A%7B%22%40id%22%3A%22https%3A%2F%2Fifttt.com%2Fchannels%2Fgoogle_talk%2Factions%2F23%22%7D%2C%22dcterms%3Atitle%22%3A%22Inform%20of%20new%20emails%22%2C%22ewe%3AtimesUsed%22%3A%220%22%2C%22ewe%3AtriggeredBy%22%3A%7B%22%40id%22%3A%22https%3A%2F%2Fifttt.com%2Fchannels%2Fgmail%2Ftriggers%2F185%22%7D%2C%22ewe%3AhasCreator%22%3A%7B%22%40id%22%3A%22http%3A%2F%2Fgsi.dit.upm.es%2Fontologies%2Fexample%23User_1%22%7D%2C%22dcterms%3Adescription%22%3A%22It%20sends%20the%20user%20a%20new%20chat%20message%20thought%20the%20GoogleTalk%20channel%20every%20time%20a%20new%20email%20is%20received.%20The%20content%20of%20the%20chat%20message%20specify%20the%20senders%20email%20address%2C%20so%20the%20user%20can%20decide%20if%20it%20is%20important%20or%20not.%22%2C%22http%3A%2F%2Fspinrdf.org%2Fspin%23query%22%3A%7B%22spinrdf%3Atemplates%22%3A%7B%22%40list%22%3A%5B%7B%22spinrdf%3Apredicate%22%3A%7B%22%40id%22%3A%22rdf%3Atype%22%7D%2C%22spinrdf%3Aobject%22%3A%7B%22%40id%22%3A%22http%3A%2F%2Fgsi.dit.upm.es%2Fontologies%2Fewe%23Action%22%7D%2C%22%40id%22%3A%22_%3Ab11%22%2C%22spinrdf%3Asubject%22%3A%7B%22%40id%22%3A%22_%3Ab38%22%2C%22spinrdf%3AvarName%22%3A%22action%22%7D%7D%2C%7B%22spinrdf%3Apredicate%22%3A%7B%22%40id%22%3A%22dcterms%3Atitle%22%7D%2C%22spinrdf%3Aobject%22%3A%22New%20chat%20message%22%2C%22%40id%22%3A%22_%3Ab12%22%2C%22spinrdf%3Asubject%22%3A%7B%22%40id%22%3A%22_%3Ab23%22%2C%22spinrdf%3AvarName%22%3A%22action%22%7D%7D%2C%7B%22spinrdf%3Apredicate%22%3A%7B%22%40id%22%3A%22http%3A%2F%2Fgsi.dit.upm.es%2Fontologies%2Fewe%23hasParameter%22%7D%2C%22spinrdf%3Aobject%22%3A%7B%22%40id%22%3A%22_%3Ab37%22%2C%22spinrdf%3AvarName%22%3A%22iParam%22%7D%2C%22%40id%22%3A%22_%3Ab13%22%2C%22spinrdf%3Asubject%22%3A%7B%22%40id%22%3A%22_%3Ab32%22%2C%22spinrdf%3AvarName%22%3A%22action%22%7D%7D%2C%7B%22spinrdf%3Apredicate%22%3A%7B%22%40id%22%3A%22dcterms%3Atitle%22%7D%2C%22spinrdf%3Aobject%22%3A%22message%22%2C%22%40id%22%3A%22_%3Ab7%22%2C%22spinrdf%3Asubject%22%3A%7B%22%40id%22%3A%22_%3Ab8%22%2C%22spinrdf%3AvarName%22%3A%22iParam%22%7D%7D%2C%7B%22spinrdf%3Apredicate%22%3A%7B%22%40id%22%3A%22dcterms%3Avalue%22%7D%2C%22spinrdf%3Aobject%22%3A%7B%22%40id%22%3A%22_%3Ab0%22%2C%22spinrdf%3AvarName%22%3A%22message%22%7D%2C%22%40id%22%3A%22_%3Ab2%22%2C%22spinrdf%3Asubject%22%3A%7B%22%40id%22%3A%22_%3Ab3%22%2C%22spinrdf%3AvarName%22%3A%22iParam%22%7D%7D%2C%7B%22spinrdf%3Apredicate%22%3A%7B%22%40id%22%3A%22http%3A%2F%2Fgsi.dit.upm.es%2Fontologies%2Fewe%23providesAction%22%7D%2C%22spinrdf%3Aobject%22%3A%7B%22%40id%22%3A%22_%3Ab5%22%2C%22spinrdf%3AvarName%22%3A%22action%22%7D%2C%22%40id%22%3A%22_%3Ab4%22%2C%22spinrdf%3Asubject%22%3A%7B%22%40id%22%3A%22https%3A%2F%2Fifttt.com%2FGoogleTalk%22%7D%7D%5D%7D%2C%22%40id%22%3A%22_%3Ab10%22%2C%22%40type%22%3A%22spinrdf%3AConstruct%22%2C%22spinrdf%3Awhere%22%3A%7B%22%40list%22%3A%5B%7B%22spinrdf%3Apredicate%22%3A%7B%22%40id%22%3A%22rdf%3Atype%22%7D%2C%22spinrdf%3Aobject%22%3A%7B%22%40id%22%3A%22http%3A%2F%2Fgsi.dit.upm.es%2Fontologies%2Fewe%23Event%22%7D%2C%22%40id%22%3A%22_%3Ab14%22%2C%22spinrdf%3Asubject%22%3A%7B%22%40id%22%3A%22_%3Ab36%22%2C%22spinrdf%3AvarName%22%3A%22event%22%7D%7D%2C%7B%22spinrdf%3Apredicate%22%3A%7B%22%40id%22%3A%22dcterms%3Atitle%22%7D%2C%22spinrdf%3Aobject%22%3A%22Any%20new%20email%22%2C%22%40id%22%3A%22_%3Ab15%22%2C%22spinrdf%3Asubject%22%3A%7B%22%40id%22%3A%22_%3Ab27%22%2C%22spinrdf%3AvarName%22%3A%22event%22%7D%7D%2C%7B%22spinrdf%3Apredicate%22%3A%7B%22%40id%22%3A%22http%3A%2F%2Fgsi.dit.upm.es%2Fontologies%2Fewe%23hasOutputParameter%22%7D%2C%22spinrdf%3Aobject%22%3A%7B%22%40id%22%3A%22_%3Ab35%22%2C%22spinrdf%3AvarName%22%3A%22oParam%22%7D%2C%22%40id%22%3A%22_%3Ab16%22%2C%22spinrdf%3Asubject%22%3A%7B%22%40id%22%3A%22_%3Ab33%22%2C%22spinrdf%3AvarName%22%3A%22event%22%7D%7D%2C%7B%22spinrdf%3Apredicate%22%3A%7B%22%40id%22%3A%22http%3A%2F%2Fgsi.dit.upm.es%2Fontologies%2Fewe%23generatesEvent%22%7D%2C%22spinrdf%3Aobject%22%3A%7B%22%40id%22%3A%22_%3Ab6%22%2C%22spinrdf%3AvarName%22%3A%22event%22%7D%2C%22%40id%22%3A%22_%3Ab17%22%2C%22spinrdf%3Asubject%22%3A%7B%22%40id%22%3A%22https%3A%2F%2Fifttt.com%2FGmail%22%7D%7D%2C%7B%22spinrdf%3Apredicate%22%3A%7B%22%40id%22%3A%22dcterms%3Atitle%22%7D%2C%22spinrdf%3Aobject%22%3A%22FromAddress%22%2C%22%40id%22%3A%22_%3Ab18%22%2C%22spinrdf%3Asubject%22%3A%7B%22%40id%22%3A%22_%3Ab24%22%2C%22spinrdf%3AvarName%22%3A%22oParam%22%7D%7D%2C%7B%22spinrdf%3Apredicate%22%3A%7B%22%40id%22%3A%22dcterms%3Avalue%22%7D%2C%22spinrdf%3Aobject%22%3A%7B%22%40id%22%3A%22_%3Ab31%22%2C%22spinrdf%3AvarName%22%3A%22oParamFrom%22%7D%2C%22%40id%22%3A%22_%3Ab19%22%2C%22spinrdf%3Asubject%22%3A%7B%22%40id%22%3A%22_%3Ab9%22%2C%22spinrdf%3AvarName%22%3A%22oParam%22%7D%7D%2C%7B%22%40id%22%3A%22_%3Ab20%22%2C%22%40type%22%3A%22spinrdf%3ABind%22%2C%22spinrdf%3Aexpression%22%3A%7B%22spinrdf%3Aarg2%22%3A%7B%22%40id%22%3A%22_%3Ab29%22%2C%22spinrdf%3AvarName%22%3A%22oParamFrom%22%7D%2C%22spinrdf%3Aarg1%22%3A%22You%20have%20received%20a%20new%20message%20from%20%22%2C%22%40id%22%3A%22_%3Ab28%22%2C%22%40type%22%3A%22http%3A%2F%2Fwww.w3.org%2F2005%2Fxpath-functions%23concat%22%7D%2C%22spinrdf%3Avariable%22%3A%7B%22%40id%22%3A%22_%3Ab30%22%2C%22spinrdf%3AvarName%22%3A%22message%22%7D%7D%2C%7B%22%40id%22%3A%22_%3Ab21%22%2C%22%40type%22%3A%22spinrdf%3ABind%22%2C%22spinrdf%3Aexpression%22%3A%7B%22spinrdf%3Aarg1%22%3A%22http%3A%2F%2Fgsi.dit.upm.es%2Fontology%2Fewe%2Feamples%2Faction1%22%2C%22%40id%22%3A%22_%3Ab34%22%2C%22%40type%22%3A%22spinrdf%3Auri%22%7D%2C%22spinrdf%3Avariable%22%3A%7B%22%40id%22%3A%22_%3Ab1%22%2C%22spinrdf%3AvarName%22%3A%22action%22%7D%7D%2C%7B%22%40id%22%3A%22_%3Ab22%22%2C%22%40type%22%3A%22spinrdf%3ABind%22%2C%22spinrdf%3Aexpression%22%3A%7B%22spinrdf%3Aarg1%22%3A%22http%3A%2F%2Fgsi.dit.upm.es%2Fontology%2Fewe%2Feamples%2Fparam1%22%2C%22%40id%22%3A%22_%3Ab25%22%2C%22%40type%22%3A%22spinrdf%3Auri%22%7D%2C%22spinrdf%3Avariable%22%3A%7B%22%40id%22%3A%22_%3Ab26%22%2C%22spinrdf%3AvarName%22%3A%22iParam%22%7D%7D%5D%7D%7D%2C%22%40id%22%3A%22http%3A%2F%2Fgsi.dit.upm.es%2Fontologies%2Fexample%23Rule_1%22%2C%22%40type%22%3A%22ewe%3ARule%22%7D%5D%7D&frame=%7B%22%40context%22%3A%7B%22foaf%22%3A%22http%3A%2F%2Fxmlns.com%2Ffoaf%2F0.1%2F%22%2C%22owl%22%3A%22http%3A%2F%2Fwww.w3.org%2F2002%2F07%2Fowl%23%22%2C%22rdf%22%3A%22http%3A%2F%2Fwww.w3.org%2F1999%2F02%2F22-rdf-syntax-ns%23%22%2C%22ewe%22%3A%22http%3A%2F%2Fgsi.dit.upm.es%2Fontologies%2Fewe%2Fns%2F%22%2C%22xsd%22%3A%22http%3A%2F%2Fwww.w3.org%2F2001%2FXMLSchema%23%22%2C%22rdfs%22%3A%22http%3A%2F%2Fwww.w3.org%2F2000%2F01%2Frdf-schema%23%22%2C%22dcterms%22%3A%22http%3A%2F%2Fpurl.org%2Fdc%2Fterms%2F%22%2C%22tags%22%3A%22http%3A%2F%2Fwww.holygoat.co.uk%2Fowl%2Fredwood%2F0.1%2Ftags%2F%22%2C%22spinrdf%22%3A%22http%3A%2F%2Fspinrdf.org%2Fsp%23%22%2C%22homepage%22%3A%7B%22%40id%22%3A%22http%3A%2F%2Fschema.org%2Furl%22%2C%22%40type%22%3A%22%40id%22%7D%2C%22image%22%3A%7B%22%40id%22%3A%22http%3A%2F%2Fschema.org%2Fimage%22%2C%22%40type%22%3A%22%40id%22%7D%7D%2C%22%40type%22%3A%22ewe%3ARule%22%7D)\n\nCon lo que te genera el conversor que usaste, en principio s\u00f3lo te hace falta hacer compactaci\u00f3n.\nSi ves que te sigue saliendo lo de \"@graph\", prueba a hacer framing con el contexto de abajo :)" }, { "cell_type": "code", "collapsed": false, "input": "from rdflib import Graph\ng = Graph()", "language": "python", "metadata": {}, "outputs": [], "prompt_number": 1 }, { "cell_type": "code", "collapsed": true, "input": " # rdf = open('example.rdf', 'r')\n from StringIO import StringIO\n rdf = StringIO('''\n \n \n \n \n \n Gmail\n Googles approach to email, Gmail, is built on the idea that email can be moreintuitive, efficient, and useful. And maybe even fun.\n http://gmail.com\n https://ifttt.com/images/channels/gmail_lrg.png\n \n \n \n \n \n \n \n \n \n \n \n \n New email from search \n This Trigger fires every time a new email arrives in your inbox that matchesthe search query you specify. \n \n \n FromAddress \n Email address of sender. \n somebody@gmail.com \n \n \n \n \n Subject \n Email subject line. \n Hello there \n \n \n \n \n BodyPlain \n Plain text email body. \n Been having a good day so far... \n \n \n \n \n FirstAttachmentPrivateURL \n A URL to the first file attachment (if any) that only you can see. \n https://locker.ifttt.com/f/29b08556-ac73-11e2-a707-22000a9730cf \n \n \n \n \n FirstAttachmentPublicURL \n A URL to the first file attachment (if any) that anyone can see. \n https://locker.ifttt.com/f/4bfc930c-ac73-11e2-b086-22000a9730cf \n \n \n \n \n FirstAttachmentFilename \n The filename of the first file attachment (if any). \n LadyTheDog.png \n \n \n \n \n ReceivedAt \n Date and time email was received. \n August 23, 2010 at 11:01PM \n \n \n \n \n Search for \n string_value \n \n \n \n \n \n \n New email labeled \n This Trigger fires every time a new email arrives in your inbox with the labelyou specify. \n \n \n FromAddress \n Email address of sender. \n somebody@gmail.com \n \n \n \n \n Subject \n Email subject line. \n Hello there \n \n \n \n \n BodyPlain \n Plain text email body. \n Been having a good day so far... \n \n \n \n \n FirstAttachmentPrivateURL \n A URL to the first file attachment (if any) that only you can see. \n https://locker.ifttt.com/f/29b08556-ac73-11e2-a707-22000a9730cf \n \n \n \n \n FirstAttachmentPublicURL \n A URL to the first file attachment (if any) that anyone can see. \n https://locker.ifttt.com/f/4bfc930c-ac73-11e2-b086-22000a9730cf \n \n \n \n \n FirstAttachmentFilename \n The filename of the first file attachment (if any). \n LadyTheDog.png \n \n \n \n \n Label \n The Gmail label from trigger. \n Work \n \n \n \n \n ReceivedAt \n Date and time email was received. \n August 23, 2010 at 11:01PM \n \n \n \n \n Label \n string_value \n \n \n \n \n \n New starred email \n This Trigger fires every time you add any new star to an email. \n \n \n FromAddress \n Email address of sender. \n somebody@gmail.com \n \n \n \n \n Subject \n Email subject line. \n Hello there \n \n \n \n \n BodyPlain \n Plain text email body. \n Been having a good day so far... \n \n \n \n \n FirstAttachmentPrivateURL \n A URL to the first file attachment (if any) that only you can see. \n https://locker.ifttt.com/f/29b08556-ac73-11e2-a707-22000a9730cf \n \n \n \n \n FirstAttachmentPublicURL \n A URL to the first file attachment (if any) that anyone can see. \n https://locker.ifttt.com/f/4bfc930c-ac73-11e2-b086-22000a9730cf \n \n \n \n \n FirstAttachmentFilename \n The filename of the first file attachment (if any). \n LadyTheDog.png \n \n \n \n \n ReceivedAt \n Date and time email was received. \n August 23, 2010 at 11:01PM \n \n \n \n \n \n \n New email from \n This Trigger fires every time a new email arrives in your inbox from theaddress you specify. \n \n \n FromAddress \n Email address of sender. \n somebody@gmail.com \n \n \n \n \n Subject \n Email subject line. \n Hello there \n \n \n \n \n BodyPlain \n Plain text email body. \n Been having a good day so far... \n \n \n \n \n FirstAttachmentPrivateURL \n A URL to the first file attachment (if any) that only you can see. \n https://locker.ifttt.com/f/29b08556-ac73-11e2-a707-22000a9730cf \n \n \n \n \n FirstAttachmentPublicURL \n A URL to the first file attachment (if any) that anyone can see. \n https://locker.ifttt.com/f/4bfc930c-ac73-11e2-b086-22000a9730cf \n \n \n \n \n FirstAttachmentFilename \n The filename of the first file attachment (if any). \n LadyTheDog.png \n \n \n \n \n ReceivedAt \n Date and time email was received. \n August 23, 2010 at 11:01PM \n \n \n \n \n Email address \n string_value \n \n \n \n \n \n Any new attachment \n This Trigger fires for every email attachment that arrives in your inbox.NOTE: Multiple attachments each fire separately. \n \n \n FromAddress \n Email address of sender. \n somebody@gmail.com \n \n \n \n \n Subject \n Email subject line. \n Hello there \n \n \n \n \n BodyPlain \n Plain text email body. \n Been having a good day so far... \n \n \n \n \n AttachmentPrivateURL \n A URL to the file attachment that only you can see. \n https://locker.ifttt.com/f/29b08556-ac73-11e2-a707-22000a9730cf \n \n \n \n \n AttachmentPublicURL \n A URL to the file attachment that anyone can see. \n https://locker.ifttt.com/f/4bfc930c-ac73-11e2-b086-22000a9730cf \n \n \n \n \n AttachmentFilename \n The filename of the attachment. \n LadyTheDog.png \n \n \n \n \n ReceivedAt \n Date and time email was received. \n August 23, 2010 at 11:01PM \n \n \n \n \n \n \n Any new email \n This Trigger fires every time any new email arrives in Gmail. \n \n \n FromAddress \n Email address of sender. \n somebody@gmail.com \n \n \n \n \n Subject \n Email subject line. \n Hello there \n \n \n \n \n BodyPlain \n Plain text email body. \n Been having a good day so far... \n \n \n \n \n FirstAttachmentPrivateURL \n A URL to the first file attachment (if any) that only you can see. \n https://locker.ifttt.com/f/29b08556-ac73-11e2-a707-22000a9730cf \n \n \n \n \n FirstAttachmentPublicURL \n A URL to the first file attachment (if any) that anyone can see. \n https://locker.ifttt.com/f/4bfc930c-ac73-11e2-b086-22000a9730cf \n \n \n \n \n FirstAttachmentFilename \n The filename of the first file attachment (if any). \n LadyTheDog.png \n \n \n \n \n ReceivedAt \n Date and time email was received. \n August 23, 2010 at 11:01PM \n \n \n \n \n \n \n Send an email\n This Action will send an email to a single recipient from your Gmail account.\n \n \n To address\n single email address only \n \n \n \n \n Subject\n \n \n \n \n Body\n some HTML ok\n \n \n \n \n Attachment URL\n URL to include as an attachment\n \n \n \n \n \n ''')", "language": "python", "metadata": {}, "outputs": [], "prompt_number": 21 }, { "cell_type": "code", "collapsed": false, "input": "g.parse(rdf)\nnt = g.serialize(format='nt')", "language": "python", "metadata": {}, "outputs": [], "prompt_number": 14 }, { "cell_type": "code", "collapsed": false, "input": "#nt = open('example.nt','r').read()", "language": "python", "metadata": {}, "outputs": [], "prompt_number": 2 }, { "cell_type": "code", "collapsed": false, "input": "from pyld import jsonld\nimport json", "language": "python", "metadata": {}, "outputs": [], "prompt_number": 15 }, { "cell_type": "code", "collapsed": false, "input": "j = jsonld.from_rdf(nt)", "language": "python", "metadata": {}, "outputs": [], "prompt_number": 18 }, { "cell_type": "code", "collapsed": false, "input": "frame = {\n \"@context\": {\n \"foaf\": \"http://xmlns.com/foaf/0.1/\",\n \"owl\": \"http://www.w3.org/2002/07/owl#\",\n \"rdf\": \"http://www.w3.org/1999/02/22-rdf-syntax-ns#\",\n \"ewe\": \"http://gsi.dit.upm.es/ontologies/ewe/ns/\",\n \"xsd\": \"http://www.w3.org/2001/XMLSchema#\",\n \"rdfs\": \"http://www.w3.org/2000/01/rdf-schema#\",\n \"dcterms\": \"http://purl.org/dc/terms/\",\n \"tags\": \"http://www.holygoat.co.uk/owl/redwood/0.1/tags/\",\n \"spinrdf\": \"http://spinrdf.org/sp#\",\n \"homepage\": {\n \"@id\": \"http://schema.org/url\",\n \"@type\": \"@id\"\n },\n \"image\": {\n \"@id\": \"http://schema.org/image\",\n \"@type\": \"@id\"\n }\n },\n \"@type\": \"ewe:Rule\"\n}\nugly = jsonld.frame(j, frame)\nprint json.dumps(jsonld.compact(ugly, frame), indent=4, sort_keys=True)", "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": "{\n \"@context\": {\n \"dcterms\": \"http://purl.org/dc/terms/\", \n \"ewe\": \"http://gsi.dit.upm.es/ontologies/ewe/ns/\", \n \"foaf\": \"http://xmlns.com/foaf/0.1/\", \n \"homepage\": {\n \"@id\": \"http://schema.org/url\", \n \"@type\": \"@id\"\n }, \n \"image\": {\n \"@id\": \"http://schema.org/image\", \n \"@type\": \"@id\"\n }, \n \"owl\": \"http://www.w3.org/2002/07/owl#\", \n \"rdf\": \"http://www.w3.org/1999/02/22-rdf-syntax-ns#\", \n \"rdfs\": \"http://www.w3.org/2000/01/rdf-schema#\", \n \"spinrdf\": \"http://spinrdf.org/sp#\", \n \"tags\": \"http://www.holygoat.co.uk/owl/redwood/0.1/tags/\", \n \"xsd\": \"http://www.w3.org/2001/XMLSchema#\"\n }, \n \"@id\": \"http://gsi.dit.upm.es/ontologies/example#Rule_1\", \n \"@type\": \"ewe:Rule\", \n \"dcterms:description\": \"It sends the user a new chat message thought the GoogleTalk channel every time a new email is received. The content of the chat message specify the senders email address, so the user can decide if it is important or not.\", \n \"dcterms:title\": \"Inform of new emails\", \n \"ewe:executes\": {\n \"@id\": \"https://ifttt.com/channels/google_talk/actions/23\"\n }, \n \"ewe:hasCreator\": {\n \"@id\": \"http://gsi.dit.upm.es/ontologies/example#User_1\"\n }, \n \"ewe:timesUsed\": \"0\", \n \"ewe:triggeredBy\": {\n \"@id\": \"https://ifttt.com/channels/gmail/triggers/185\", \n \"@type\": \"ewe:Event\", \n \"dcterms:description\": \"This Trigger fires every time any new email arrives in Gmail.\", \n \"dcterms:title\": \"Any new email\", \n \"ewe:hasOutputParameter\": [\n {\n \"@id\": \"_:b54\", \n \"@type\": \"ewe:outputParameter\", \n \"dcterms:description\": \"A URL to the first file attachment (if any) that anyone can see.\", \n \"dcterms:title\": \"FirstAttachmentPublicURL\", \n \"ewe:example\": \"https://locker.ifttt.com/f/4bfc930c-ac73-11e2-b086-22000a9730cf\"\n }, \n {\n \"@id\": \"_:b67\", \n \"@type\": \"ewe:outputParameter\", \n \"dcterms:description\": \"Email address of sender.\", \n \"dcterms:title\": \"FromAddress\", \n \"ewe:example\": \"somebody@gmail.com\"\n }, \n {\n \"@id\": \"_:b68\", \n \"@type\": \"ewe:outputParameter\", \n \"dcterms:description\": \"The filename of the first file attachment (if any).\", \n \"dcterms:title\": \"FirstAttachmentFilename\", \n \"ewe:example\": \"LadyTheDog.png\"\n }, \n {\n \"@id\": \"_:b20\", \n \"@type\": \"ewe:outputParameter\", \n \"dcterms:description\": \"Email subject line.\", \n \"dcterms:title\": \"Subject\", \n \"ewe:example\": \"Hello there\"\n }, \n {\n \"@id\": \"_:b5\", \n \"@type\": \"ewe:outputParameter\", \n \"dcterms:description\": \"Date and time email was received.\", \n \"dcterms:title\": \"ReceivedAt\", \n \"ewe:example\": \"August 23, 2010 at 11:01PM\"\n }, \n {\n \"@id\": \"_:b71\", \n \"@type\": \"ewe:outputParameter\", \n \"dcterms:description\": \"A URL to the first file attachment (if any) that only you can see.\", \n \"dcterms:title\": \"FirstAttachmentPrivateURL\", \n \"ewe:example\": \"https://locker.ifttt.com/f/29b08556-ac73-11e2-a707-22000a9730cf\"\n }, \n {\n \"@id\": \"_:b16\", \n \"@type\": \"ewe:outputParameter\", \n \"dcterms:description\": \"Plain text email body.\", \n \"dcterms:title\": \"BodyPlain\", \n \"ewe:example\": \"Been having a good day so far...\"\n }\n ]\n }, \n \"http://spinrdf.org/spin#query\": {\n \"@id\": \"_:b31\", \n \"@type\": \"spinrdf:Construct\", \n \"spinrdf:templates\": {\n \"@list\": [\n {\n \"@id\": \"_:b32\", \n \"spinrdf:object\": {\n \"@id\": \"http://gsi.dit.upm.es/ontologies/ewe#Action\"\n }, \n \"spinrdf:predicate\": {\n \"@id\": \"rdf:type\"\n }, \n \"spinrdf:subject\": {\n \"@id\": \"_:b58\", \n \"spinrdf:varName\": \"action\"\n }\n }, \n {\n \"@id\": \"_:b33\", \n \"spinrdf:object\": \"New chat message\", \n \"spinrdf:predicate\": {\n \"@id\": \"dcterms:title\"\n }, \n \"spinrdf:subject\": {\n \"@id\": \"_:b78\", \n \"spinrdf:varName\": \"action\"\n }\n }, \n {\n \"@id\": \"_:b34\", \n \"spinrdf:object\": {\n \"@id\": \"_:b45\", \n \"spinrdf:varName\": \"iParam\"\n }, \n \"spinrdf:predicate\": {\n \"@id\": \"http://gsi.dit.upm.es/ontologies/ewe#hasParameter\"\n }, \n \"spinrdf:subject\": {\n \"@id\": \"_:b17\", \n \"spinrdf:varName\": \"action\"\n }\n }, \n {\n \"@id\": \"_:b0\", \n \"spinrdf:object\": \"message\", \n \"spinrdf:predicate\": {\n \"@id\": \"dcterms:title\"\n }, \n \"spinrdf:subject\": {\n \"@id\": \"_:b1\", \n \"spinrdf:varName\": \"iParam\"\n }\n }, \n {\n \"@id\": \"_:b35\", \n \"spinrdf:object\": {\n \"@id\": \"_:b64\", \n \"spinrdf:varName\": \"message\"\n }, \n \"spinrdf:predicate\": {\n \"@id\": \"dcterms:value\"\n }, \n \"spinrdf:subject\": {\n \"@id\": \"_:b43\", \n \"spinrdf:varName\": \"iParam\"\n }\n }, \n {\n \"@id\": \"_:b36\", \n \"spinrdf:object\": {\n \"@id\": \"_:b63\", \n \"spinrdf:varName\": \"action\"\n }, \n \"spinrdf:predicate\": {\n \"@id\": \"http://gsi.dit.upm.es/ontologies/ewe#providesAction\"\n }, \n \"spinrdf:subject\": {\n \"@id\": \"https://ifttt.com/GoogleTalk\"\n }\n }\n ]\n }, \n \"spinrdf:where\": {\n \"@list\": [\n {\n \"@id\": \"_:b37\", \n \"spinrdf:object\": {\n \"@id\": \"http://gsi.dit.upm.es/ontologies/ewe#Event\"\n }, \n \"spinrdf:predicate\": {\n \"@id\": \"rdf:type\"\n }, \n \"spinrdf:subject\": {\n \"@id\": \"_:b2\", \n \"spinrdf:varName\": \"event\"\n }\n }, \n {\n \"@id\": \"_:b38\", \n \"spinrdf:object\": \"Any new email\", \n \"spinrdf:predicate\": {\n \"@id\": \"dcterms:title\"\n }, \n \"spinrdf:subject\": {\n \"@id\": \"_:b3\", \n \"spinrdf:varName\": \"event\"\n }\n }, \n {\n \"@id\": \"_:b27\", \n \"spinrdf:object\": {\n \"@id\": \"_:b21\", \n \"spinrdf:varName\": \"oParam\"\n }, \n \"spinrdf:predicate\": {\n \"@id\": \"http://gsi.dit.upm.es/ontologies/ewe#hasOutputParameter\"\n }, \n \"spinrdf:subject\": {\n \"@id\": \"_:b28\", \n \"spinrdf:varName\": \"event\"\n }\n }, \n {\n \"@id\": \"_:b13\", \n \"spinrdf:object\": {\n \"@id\": \"_:b14\", \n \"spinrdf:varName\": \"event\"\n }, \n \"spinrdf:predicate\": {\n \"@id\": \"http://gsi.dit.upm.es/ontologies/ewe#generatesEvent\"\n }, \n \"spinrdf:subject\": {\n \"@id\": \"https://ifttt.com/Gmail\"\n }\n }, \n {\n \"@id\": \"_:b39\", \n \"spinrdf:object\": \"FromAddress\", \n \"spinrdf:predicate\": {\n \"@id\": \"dcterms:title\"\n }, \n \"spinrdf:subject\": {\n \"@id\": \"_:b26\", \n \"spinrdf:varName\": \"oParam\"\n }\n }, \n {\n \"@id\": \"_:b40\", \n \"spinrdf:object\": {\n \"@id\": \"_:b65\", \n \"spinrdf:varName\": \"oParamFrom\"\n }, \n \"spinrdf:predicate\": {\n \"@id\": \"dcterms:value\"\n }, \n \"spinrdf:subject\": {\n \"@id\": \"_:b66\", \n \"spinrdf:varName\": \"oParam\"\n }\n }, \n {\n \"@id\": \"_:b41\", \n \"@type\": \"spinrdf:Bind\", \n \"spinrdf:expression\": {\n \"@id\": \"_:b11\", \n \"@type\": \"http://www.w3.org/2005/xpath-functions#concat\", \n \"spinrdf:arg1\": \"You have received a new message from \", \n \"spinrdf:arg2\": {\n \"@id\": \"_:b12\", \n \"spinrdf:varName\": \"oParamFrom\"\n }\n }, \n \"spinrdf:variable\": {\n \"@id\": \"_:b61\", \n \"spinrdf:varName\": \"message\"\n }\n }, \n {\n \"@id\": \"_:b42\", \n \"@type\": \"spinrdf:Bind\", \n \"spinrdf:expression\": {\n \"@id\": \"_:b50\", \n \"@type\": \"spinrdf:uri\", \n \"spinrdf:arg1\": \"http://gsi.dit.upm.es/ontology/ewe/eamples/action1\"\n }, \n \"spinrdf:variable\": {\n \"@id\": \"_:b75\", \n \"spinrdf:varName\": \"action\"\n }\n }, \n {\n \"@id\": \"_:b22\", \n \"@type\": \"spinrdf:Bind\", \n \"spinrdf:expression\": {\n \"@id\": \"_:b23\", \n \"@type\": \"spinrdf:uri\", \n \"spinrdf:arg1\": \"http://gsi.dit.upm.es/ontology/ewe/eamples/param1\"\n }, \n \"spinrdf:variable\": {\n \"@id\": \"_:b24\", \n \"spinrdf:varName\": \"iParam\"\n }\n }\n ]\n }\n }\n}\n" } ], "prompt_number": 19 }, { "cell_type": "code", "collapsed": false, "input": "print json.dumps(ugly, indent=2)", "language": "python", "metadata": {}, "outputs": [ { "output_type": "stream", "stream": "stdout", "text": "{\n \"@context\": {\n \"foaf\": \"http://xmlns.com/foaf/0.1/\", \n \"owl\": \"http://www.w3.org/2002/07/owl#\", \n \"rdfs\": \"http://www.w3.org/2000/01/rdf-schema#\", \n \"image\": {\n \"@id\": \"http://schema.org/image\", \n \"@type\": \"@id\"\n }, \n \"tags\": \"http://www.holygoat.co.uk/owl/redwood/0.1/tags/\", \n \"ewe\": \"http://gsi.dit.upm.es/ontologies/ewe/ns/\", \n \"rdf\": \"http://www.w3.org/1999/02/22-rdf-syntax-ns#\", \n \"xsd\": \"http://www.w3.org/2001/XMLSchema#\", \n \"dcterms\": \"http://purl.org/dc/terms/\", \n \"homepage\": {\n \"@id\": \"http://schema.org/url\", \n \"@type\": \"@id\"\n }, \n \"spinrdf\": \"http://spinrdf.org/sp#\"\n }, \n \"@graph\": [\n {\n \"ewe:executes\": {\n \"@id\": \"https://ifttt.com/channels/google_talk/actions/23\"\n }, \n \"dcterms:title\": \"Inform of new emails\", \n \"ewe:timesUsed\": \"0\", \n \"ewe:triggeredBy\": {\n \"dcterms:title\": \"Any new email\", \n \"dcterms:description\": \"This Trigger fires every time any new email arrives in Gmail.\", \n \"@id\": \"https://ifttt.com/channels/gmail/triggers/185\", \n \"@type\": \"ewe:Event\", \n \"ewe:hasOutputParameter\": [\n {\n \"dcterms:title\": \"FirstAttachmentPublicURL\", \n \"@id\": \"_:b54\", \n \"@type\": \"ewe:outputParameter\", \n \"ewe:example\": \"https://locker.ifttt.com/f/4bfc930c-ac73-11e2-b086-22000a9730cf\", \n \"dcterms:description\": \"A URL to the first file attachment (if any) that anyone can see.\"\n }, \n {\n \"dcterms:title\": \"FromAddress\", \n \"@id\": \"_:b67\", \n \"@type\": \"ewe:outputParameter\", \n \"ewe:example\": \"somebody@gmail.com\", \n \"dcterms:description\": \"Email address of sender.\"\n }, \n {\n \"dcterms:title\": \"FirstAttachmentFilename\", \n \"@id\": \"_:b68\", \n \"@type\": \"ewe:outputParameter\", \n \"ewe:example\": \"LadyTheDog.png\", \n \"dcterms:description\": \"The filename of the first file attachment (if any).\"\n }, \n {\n \"dcterms:title\": \"Subject\", \n \"@id\": \"_:b20\", \n \"@type\": \"ewe:outputParameter\", \n \"ewe:example\": \"Hello there\", \n \"dcterms:description\": \"Email subject line.\"\n }, \n {\n \"dcterms:title\": \"ReceivedAt\", \n \"@id\": \"_:b5\", \n \"@type\": \"ewe:outputParameter\", \n \"ewe:example\": \"August 23, 2010 at 11:01PM\", \n \"dcterms:description\": \"Date and time email was received.\"\n }, \n {\n \"dcterms:title\": \"FirstAttachmentPrivateURL\", \n \"@id\": \"_:b71\", \n \"@type\": \"ewe:outputParameter\", \n \"ewe:example\": \"https://locker.ifttt.com/f/29b08556-ac73-11e2-a707-22000a9730cf\", \n \"dcterms:description\": \"A URL to the first file attachment (if any) that only you can see.\"\n }, \n {\n \"dcterms:title\": \"BodyPlain\", \n \"@id\": \"_:b16\", \n \"@type\": \"ewe:outputParameter\", \n \"ewe:example\": \"Been having a good day so far...\", \n \"dcterms:description\": \"Plain text email body.\"\n }\n ]\n }, \n \"ewe:hasCreator\": {\n \"@id\": \"http://gsi.dit.upm.es/ontologies/example#User_1\"\n }, \n \"dcterms:description\": \"It sends the user a new chat message thought the GoogleTalk channel every time a new email is received. The content of the chat message specify the senders email address, so the user can decide if it is important or not.\", \n \"http://spinrdf.org/spin#query\": {\n \"spinrdf:templates\": {\n \"@list\": [\n {\n \"spinrdf:predicate\": {\n \"@id\": \"rdf:type\"\n }, \n \"spinrdf:object\": {\n \"@id\": \"http://gsi.dit.upm.es/ontologies/ewe#Action\"\n }, \n \"@id\": \"_:b32\", \n \"spinrdf:subject\": {\n \"@id\": \"_:b58\", \n \"spinrdf:varName\": \"action\"\n }\n }, \n {\n \"spinrdf:predicate\": {\n \"@id\": \"dcterms:title\"\n }, \n \"spinrdf:object\": \"New chat message\", \n \"@id\": \"_:b33\", \n \"spinrdf:subject\": {\n \"@id\": \"_:b78\", \n \"spinrdf:varName\": \"action\"\n }\n }, \n {\n \"spinrdf:predicate\": {\n \"@id\": \"http://gsi.dit.upm.es/ontologies/ewe#hasParameter\"\n }, \n \"spinrdf:object\": {\n \"@id\": \"_:b45\", \n \"spinrdf:varName\": \"iParam\"\n }, \n \"@id\": \"_:b34\", \n \"spinrdf:subject\": {\n \"@id\": \"_:b17\", \n \"spinrdf:varName\": \"action\"\n }\n }, \n {\n \"spinrdf:predicate\": {\n \"@id\": \"dcterms:title\"\n }, \n \"spinrdf:object\": \"message\", \n \"@id\": \"_:b0\", \n \"spinrdf:subject\": {\n \"@id\": \"_:b1\", \n \"spinrdf:varName\": \"iParam\"\n }\n }, \n {\n \"spinrdf:predicate\": {\n \"@id\": \"dcterms:value\"\n }, \n \"spinrdf:object\": {\n \"@id\": \"_:b64\", \n \"spinrdf:varName\": \"message\"\n }, \n \"@id\": \"_:b35\", \n \"spinrdf:subject\": {\n \"@id\": \"_:b43\", \n \"spinrdf:varName\": \"iParam\"\n }\n }, \n {\n \"spinrdf:predicate\": {\n \"@id\": \"http://gsi.dit.upm.es/ontologies/ewe#providesAction\"\n }, \n \"spinrdf:object\": {\n \"@id\": \"_:b63\", \n \"spinrdf:varName\": \"action\"\n }, \n \"@id\": \"_:b36\", \n \"spinrdf:subject\": {\n \"@id\": \"https://ifttt.com/GoogleTalk\"\n }\n }\n ]\n }, \n \"@id\": \"_:b31\", \n \"@type\": \"spinrdf:Construct\", \n \"spinrdf:where\": {\n \"@list\": [\n {\n \"spinrdf:predicate\": {\n \"@id\": \"rdf:type\"\n }, \n \"spinrdf:object\": {\n \"@id\": \"http://gsi.dit.upm.es/ontologies/ewe#Event\"\n }, \n \"@id\": \"_:b37\", \n \"spinrdf:subject\": {\n \"@id\": \"_:b2\", \n \"spinrdf:varName\": \"event\"\n }\n }, \n {\n \"spinrdf:predicate\": {\n \"@id\": \"dcterms:title\"\n }, \n \"spinrdf:object\": \"Any new email\", \n \"@id\": \"_:b38\", \n \"spinrdf:subject\": {\n \"@id\": \"_:b3\", \n \"spinrdf:varName\": \"event\"\n }\n }, \n {\n \"spinrdf:predicate\": {\n \"@id\": \"http://gsi.dit.upm.es/ontologies/ewe#hasOutputParameter\"\n }, \n \"spinrdf:object\": {\n \"@id\": \"_:b21\", \n \"spinrdf:varName\": \"oParam\"\n }, \n \"@id\": \"_:b27\", \n \"spinrdf:subject\": {\n \"@id\": \"_:b28\", \n \"spinrdf:varName\": \"event\"\n }\n }, \n {\n \"spinrdf:predicate\": {\n \"@id\": \"http://gsi.dit.upm.es/ontologies/ewe#generatesEvent\"\n }, \n \"spinrdf:object\": {\n \"@id\": \"_:b14\", \n \"spinrdf:varName\": \"event\"\n }, \n \"@id\": \"_:b13\", \n \"spinrdf:subject\": {\n \"@id\": \"https://ifttt.com/Gmail\"\n }\n }, \n {\n \"spinrdf:predicate\": {\n \"@id\": \"dcterms:title\"\n }, \n \"spinrdf:object\": \"FromAddress\", \n \"@id\": \"_:b39\", \n \"spinrdf:subject\": {\n \"@id\": \"_:b26\", \n \"spinrdf:varName\": \"oParam\"\n }\n }, \n {\n \"spinrdf:predicate\": {\n \"@id\": \"dcterms:value\"\n }, \n \"spinrdf:object\": {\n \"@id\": \"_:b65\", \n \"spinrdf:varName\": \"oParamFrom\"\n }, \n \"@id\": \"_:b40\", \n \"spinrdf:subject\": {\n \"@id\": \"_:b66\", \n \"spinrdf:varName\": \"oParam\"\n }\n }, \n {\n \"@id\": \"_:b41\", \n \"@type\": \"spinrdf:Bind\", \n \"spinrdf:expression\": {\n \"spinrdf:arg2\": {\n \"@id\": \"_:b12\", \n \"spinrdf:varName\": \"oParamFrom\"\n }, \n \"spinrdf:arg1\": \"You have received a new message from \", \n \"@id\": \"_:b11\", \n \"@type\": \"http://www.w3.org/2005/xpath-functions#concat\"\n }, \n \"spinrdf:variable\": {\n \"@id\": \"_:b61\", \n \"spinrdf:varName\": \"message\"\n }\n }, \n {\n \"@id\": \"_:b42\", \n \"@type\": \"spinrdf:Bind\", \n \"spinrdf:expression\": {\n \"spinrdf:arg1\": \"http://gsi.dit.upm.es/ontology/ewe/eamples/action1\", \n \"@id\": \"_:b50\", \n \"@type\": \"spinrdf:uri\"\n }, \n \"spinrdf:variable\": {\n \"@id\": \"_:b75\", \n \"spinrdf:varName\": \"action\"\n }\n }, \n {\n \"@id\": \"_:b22\", \n \"@type\": \"spinrdf:Bind\", \n \"spinrdf:expression\": {\n \"spinrdf:arg1\": \"http://gsi.dit.upm.es/ontology/ewe/eamples/param1\", \n \"@id\": \"_:b23\", \n \"@type\": \"spinrdf:uri\"\n }, \n \"spinrdf:variable\": {\n \"@id\": \"_:b24\", \n \"spinrdf:varName\": \"iParam\"\n }\n }\n ]\n }\n }, \n \"@id\": \"http://gsi.dit.upm.es/ontologies/example#Rule_1\", \n \"@type\": \"ewe:Rule\"\n }\n ]\n}\n" } ], "prompt_number": 20 } ], "metadata": {} } ] }