commit 11374ce91c9c939fb240ddb6b76144118d85e2b5 Author: J. Fernando Sánchez Date: Wed Apr 2 12:27:49 2014 -0700 diff --git a/migueljsonld.ipynb b/migueljsonld.ipynb new file mode 100644 index 0000000..0b6b7b9 --- /dev/null +++ b/migueljsonld.ipynb @@ -0,0 +1,85 @@ +{ + "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()\ng.parse('example.rdf')\nnt = g.serialize(format='nt')", + "language": "python", + "metadata": {}, + "outputs": [], + "prompt_number": 1 + }, + { + "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": 3 + }, + { + "cell_type": "code", + "collapsed": false, + "input": "rdf = jsonld.from_rdf(nt)", + "language": "python", + "metadata": {}, + "outputs": [], + "prompt_number": 4 + }, + { + "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(rdf, 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 }, \n \"http://spinrdf.org/spin#query\": {\n \"@id\": \"_:b16\", \n \"@type\": \"spinrdf:Construct\", \n \"spinrdf:templates\": {\n \"@list\": [\n {\n \"@id\": \"_:b17\", \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\": \"_:b31\", \n \"spinrdf:varName\": \"action\"\n }\n }, \n {\n \"@id\": \"_:b18\", \n \"spinrdf:object\": \"New chat message\", \n \"spinrdf:predicate\": {\n \"@id\": \"dcterms:title\"\n }, \n \"spinrdf:subject\": {\n \"@id\": \"_:b38\", \n \"spinrdf:varName\": \"action\"\n }\n }, \n {\n \"@id\": \"_:b19\", \n \"spinrdf:object\": {\n \"@id\": \"_:b29\", \n \"spinrdf:varName\": \"iParam\"\n }, \n \"spinrdf:predicate\": {\n \"@id\": \"http://gsi.dit.upm.es/ontologies/ewe#hasParameter\"\n }, \n \"spinrdf:subject\": {\n \"@id\": \"_:b8\", \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\": \"_:b20\", \n \"spinrdf:object\": {\n \"@id\": \"_:b34\", \n \"spinrdf:varName\": \"message\"\n }, \n \"spinrdf:predicate\": {\n \"@id\": \"dcterms:value\"\n }, \n \"spinrdf:subject\": {\n \"@id\": \"_:b28\", \n \"spinrdf:varName\": \"iParam\"\n }\n }, \n {\n \"@id\": \"_:b21\", \n \"spinrdf:object\": {\n \"@id\": \"_:b33\", \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\": \"_:b22\", \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\": \"_:b23\", \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\": \"_:b14\", \n \"spinrdf:object\": {\n \"@id\": \"_:b9\", \n \"spinrdf:varName\": \"oParam\"\n }, \n \"spinrdf:predicate\": {\n \"@id\": \"http://gsi.dit.upm.es/ontologies/ewe#hasOutputParameter\"\n }, \n \"spinrdf:subject\": {\n \"@id\": \"_:b15\", \n \"spinrdf:varName\": \"event\"\n }\n }, \n {\n \"@id\": \"_:b6\", \n \"spinrdf:object\": {\n \"@id\": \"_:b7\", \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\": \"_:b24\", \n \"spinrdf:object\": \"FromAddress\", \n \"spinrdf:predicate\": {\n \"@id\": \"dcterms:title\"\n }, \n \"spinrdf:subject\": {\n \"@id\": \"_:b13\", \n \"spinrdf:varName\": \"oParam\"\n }\n }, \n {\n \"@id\": \"_:b25\", \n \"spinrdf:object\": {\n \"@id\": \"_:b35\", \n \"spinrdf:varName\": \"oParamFrom\"\n }, \n \"spinrdf:predicate\": {\n \"@id\": \"dcterms:value\"\n }, \n \"spinrdf:subject\": {\n \"@id\": \"_:b36\", \n \"spinrdf:varName\": \"oParam\"\n }\n }, \n {\n \"@id\": \"_:b26\", \n \"@type\": \"spinrdf:Bind\", \n \"spinrdf:expression\": {\n \"@id\": \"_:b4\", \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\": \"_:b5\", \n \"spinrdf:varName\": \"oParamFrom\"\n }\n }, \n \"spinrdf:variable\": {\n \"@id\": \"_:b32\", \n \"spinrdf:varName\": \"message\"\n }\n }, \n {\n \"@id\": \"_:b27\", \n \"@type\": \"spinrdf:Bind\", \n \"spinrdf:expression\": {\n \"@id\": \"_:b30\", \n \"@type\": \"spinrdf:uri\", \n \"spinrdf:arg1\": \"http://gsi.dit.upm.es/ontology/ewe/eamples/action1\"\n }, \n \"spinrdf:variable\": {\n \"@id\": \"_:b37\", \n \"spinrdf:varName\": \"action\"\n }\n }, \n {\n \"@id\": \"_:b10\", \n \"@type\": \"spinrdf:Bind\", \n \"spinrdf:expression\": {\n \"@id\": \"_:b11\", \n \"@type\": \"spinrdf:uri\", \n \"spinrdf:arg1\": \"http://gsi.dit.upm.es/ontology/ewe/eamples/param1\"\n }, \n \"spinrdf:variable\": {\n \"@id\": \"_:b12\", \n \"spinrdf:varName\": \"iParam\"\n }\n }\n ]\n }\n }\n}\n" + } + ], + "prompt_number": 5 + }, + { + "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 \"@id\": \"https://ifttt.com/channels/gmail/triggers/185\"\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\": \"_:b17\", \n \"spinrdf:subject\": {\n \"@id\": \"_:b31\", \n \"spinrdf:varName\": \"action\"\n }\n }, \n {\n \"spinrdf:predicate\": {\n \"@id\": \"dcterms:title\"\n }, \n \"spinrdf:object\": \"New chat message\", \n \"@id\": \"_:b18\", \n \"spinrdf:subject\": {\n \"@id\": \"_:b38\", \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\": \"_:b29\", \n \"spinrdf:varName\": \"iParam\"\n }, \n \"@id\": \"_:b19\", \n \"spinrdf:subject\": {\n \"@id\": \"_:b8\", \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\": \"_:b34\", \n \"spinrdf:varName\": \"message\"\n }, \n \"@id\": \"_:b20\", \n \"spinrdf:subject\": {\n \"@id\": \"_:b28\", \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\": \"_:b33\", \n \"spinrdf:varName\": \"action\"\n }, \n \"@id\": \"_:b21\", \n \"spinrdf:subject\": {\n \"@id\": \"https://ifttt.com/GoogleTalk\"\n }\n }\n ]\n }, \n \"@id\": \"_:b16\", \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\": \"_:b22\", \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\": \"_:b23\", \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\": \"_:b9\", \n \"spinrdf:varName\": \"oParam\"\n }, \n \"@id\": \"_:b14\", \n \"spinrdf:subject\": {\n \"@id\": \"_:b15\", \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\": \"_:b7\", \n \"spinrdf:varName\": \"event\"\n }, \n \"@id\": \"_:b6\", \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\": \"_:b24\", \n \"spinrdf:subject\": {\n \"@id\": \"_:b13\", \n \"spinrdf:varName\": \"oParam\"\n }\n }, \n {\n \"spinrdf:predicate\": {\n \"@id\": \"dcterms:value\"\n }, \n \"spinrdf:object\": {\n \"@id\": \"_:b35\", \n \"spinrdf:varName\": \"oParamFrom\"\n }, \n \"@id\": \"_:b25\", \n \"spinrdf:subject\": {\n \"@id\": \"_:b36\", \n \"spinrdf:varName\": \"oParam\"\n }\n }, \n {\n \"@id\": \"_:b26\", \n \"@type\": \"spinrdf:Bind\", \n \"spinrdf:expression\": {\n \"spinrdf:arg2\": {\n \"@id\": \"_:b5\", \n \"spinrdf:varName\": \"oParamFrom\"\n }, \n \"spinrdf:arg1\": \"You have received a new message from \", \n \"@id\": \"_:b4\", \n \"@type\": \"http://www.w3.org/2005/xpath-functions#concat\"\n }, \n \"spinrdf:variable\": {\n \"@id\": \"_:b32\", \n \"spinrdf:varName\": \"message\"\n }\n }, \n {\n \"@id\": \"_:b27\", \n \"@type\": \"spinrdf:Bind\", \n \"spinrdf:expression\": {\n \"spinrdf:arg1\": \"http://gsi.dit.upm.es/ontology/ewe/eamples/action1\", \n \"@id\": \"_:b30\", \n \"@type\": \"spinrdf:uri\"\n }, \n \"spinrdf:variable\": {\n \"@id\": \"_:b37\", \n \"spinrdf:varName\": \"action\"\n }\n }, \n {\n \"@id\": \"_:b10\", \n \"@type\": \"spinrdf:Bind\", \n \"spinrdf:expression\": {\n \"spinrdf:arg1\": \"http://gsi.dit.upm.es/ontology/ewe/eamples/param1\", \n \"@id\": \"_:b11\", \n \"@type\": \"spinrdf:uri\"\n }, \n \"spinrdf:variable\": {\n \"@id\": \"_:b12\", \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": 6 + } + ], + "metadata": {} + } + ] +}