mirror of
https://github.com/balkian/gists.git
synced 2024-10-31 23:51:44 +00:00
104 lines
70 KiB
Plaintext
104 lines
70 KiB
Plaintext
{
|
|
"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('''<?xml version=\"1.0\" encoding=\"utf-8\"?>\n \n <rdf:RDF \n xmlns:foaf=\"http://xmlns.com/foaf/0.1/\" \n xmlns:owl=\"http://www.w3.org/2002/07/owl#\" \n xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\" \n xmlns:ewe=\"http://gsi.dit.upm.es/ontologies/ewe/ns/\" \n xmlns:xsd=\"http://www.w3.org/2001/XMLSchema#\" \n xmlns:rdfs=\"http://www.w3.org/2000/01/rdf-schema#\" \n xmlns:dcterms=\"http://purl.org/dc/terms/\" \n xmlns:tags=\"http://www.holygoat.co.uk/owl/redwood/0.1/tags/\" \n xmlns=\"http://gsi.dit.upm.es/ontologies/ewe/ns/\">\n \n <!-- Channel Instance Description -->\n <ewe:Channel rdf:about=\"https://ifttt.com/gmail\">\n <dcterms:title>Gmail</dcterms:title>\n <dcterms:description>Googles approach to email, Gmail, is built on the idea that email can be moreintuitive, efficient, and useful. And maybe even fun.</dcterms:description>\n <foaf:url>http://gmail.com</foaf:url>\n <foaf:logo>https://ifttt.com/images/channels/gmail_lrg.png</foaf:logo>\n <!-- Event and action references -->\n <ewe:generatesEvent rdf:resource=\"https://ifttt.com/channels/gmail/triggers/87\" />\n <ewe:generatesEvent rdf:resource=\"https://ifttt.com/channels/gmail/triggers/85\" />\n <ewe:generatesEvent rdf:resource=\"https://ifttt.com/channels/gmail/triggers/186\" />\n <ewe:generatesEvent rdf:resource=\"https://ifttt.com/channels/gmail/triggers/86\" />\n <ewe:generatesEvent rdf:resource=\"https://ifttt.com/channels/gmail/triggers/367\" />\n <ewe:generatesEvent rdf:resource=\"https://ifttt.com/channels/gmail/triggers/185\" /> \n <ewe:providesAction rdf:resource=\"https://ifttt.com/channels/gmail/actions/34\" />\n </ewe:Channel>\n \n <!-- Event Instances -->\n <ewe:Event rdf:about=\"https://ifttt.com/channels/gmail/triggers/87\">\n <dcterms:title>New email from search</dcterms:title> \n <dcterms:description>This Trigger fires every time a new email arrives in your inbox that matchesthe search query you specify.</dcterms:description> \n <ewe:hasOutputParameter>\n <ewe:outputParameter>\n <dcterms:title>FromAddress</dcterms:title> \n <dcterms:description>Email address of sender.</dcterms:description> \n <ewe:example>somebody@gmail.com</ewe:example> \n </ewe:outputParameter>\n </ewe:hasOutputParameter>\n <ewe:hasOutputParameter>\n <ewe:outputParameter>\n <dcterms:title>Subject</dcterms:title> \n <dcterms:description>Email subject line.</dcterms:description> \n <ewe:example>Hello there</ewe:example> \n </ewe:outputParameter>\n </ewe:hasOutputParameter>\n <ewe:hasOutputParameter>\n <ewe:outputParameter>\n <dcterms:title>BodyPlain</dcterms:title> \n <dcterms:description>Plain text email body.</dcterms:description> \n <ewe:example>Been having a good day so far...</ewe:example> \n </ewe:outputParameter>\n </ewe:hasOutputParameter>\n <ewe:hasOutputParameter>\n <ewe:outputParameter>\n <dcterms:title>FirstAttachmentPrivateURL</dcterms:title> \n <dcterms:description>A URL to the first file attachment (if any) that only you can see.</dcterms:description> \n <ewe:example>https://locker.ifttt.com/f/29b08556-ac73-11e2-a707-22000a9730cf</ewe:example> \n </ewe:outputParameter>\n </ewe:hasOutputParameter>\n <ewe:hasOutputParameter>\n <ewe:outputParameter>\n <dcterms:title>FirstAttachmentPublicURL</dcterms:title> \n <dcterms:description>A URL to the first file attachment (if any) that anyone can see.</dcterms:description> \n <ewe:example>https://locker.ifttt.com/f/4bfc930c-ac73-11e2-b086-22000a9730cf</ewe:example> \n </ewe:outputParameter>\n </ewe:hasOutputParameter>\n <ewe:hasOutputParameter>\n <ewe:outputParameter>\n <dcterms:title>FirstAttachmentFilename</dcterms:title> \n <dcterms:description>The filename of the first file attachment (if any).</dcterms:description> \n <ewe:example>LadyTheDog.png</ewe:example> \n </ewe:outputParameter>\n </ewe:hasOutputParameter>\n <ewe:hasOutputParameter>\n <ewe:outputParameter>\n <dcterms:title>ReceivedAt</dcterms:title> \n <dcterms:description>Date and time email was received.</dcterms:description> \n <ewe:example>August 23, 2010 at 11:01PM</ewe:example> \n </ewe:outputParameter>\n </ewe:hasOutputParameter>\n <ewe:hasInputParameter>\n <ewe:InputParameter>\n <dcterms:title>Search for</dcterms:title> \n <xsd:type>string_value</xsd:type> \n </ewe:InputParameter> \n </ewe:hasInputParameter>\n </ewe:Event>\n \n \n <ewe:Event rdf:about=\"https://ifttt.com/channels/gmail/triggers/85\">\n <dcterms:title>New email labeled</dcterms:title> \n <dcterms:description>This Trigger fires every time a new email arrives in your inbox with the labelyou specify.</dcterms:description> \n <ewe:hasOutputParameter>\n <ewe:outputParameter>\n <dcterms:title>FromAddress</dcterms:title> \n <dcterms:description>Email address of sender.</dcterms:description> \n <ewe:example>somebody@gmail.com</ewe:example> \n </ewe:outputParameter>\n </ewe:hasOutputParameter>\n <ewe:hasOutputParameter>\n <ewe:outputParameter>\n <dcterms:title>Subject</dcterms:title> \n <dcterms:description>Email subject line.</dcterms:description> \n <ewe:example>Hello there</ewe:example> \n </ewe:outputParameter>\n </ewe:hasOutputParameter>\n <ewe:hasOutputParameter>\n <ewe:outputParameter>\n <dcterms:title>BodyPlain</dcterms:title> \n <dcterms:description>Plain text email body.</dcterms:description> \n <ewe:example>Been having a good day so far...</ewe:example> \n </ewe:outputParameter>\n </ewe:hasOutputParameter>\n <ewe:hasOutputParameter>\n <ewe:outputParameter>\n <dcterms:title>FirstAttachmentPrivateURL</dcterms:title> \n <dcterms:description>A URL to the first file attachment (if any) that only you can see.</dcterms:description> \n <ewe:example>https://locker.ifttt.com/f/29b08556-ac73-11e2-a707-22000a9730cf</ewe:example> \n </ewe:outputParameter>\n </ewe:hasOutputParameter>\n <ewe:hasOutputParameter>\n <ewe:outputParameter>\n <dcterms:title>FirstAttachmentPublicURL</dcterms:title> \n <dcterms:description>A URL to the first file attachment (if any) that anyone can see.</dcterms:description> \n <ewe:example>https://locker.ifttt.com/f/4bfc930c-ac73-11e2-b086-22000a9730cf</ewe:example> \n </ewe:outputParameter>\n </ewe:hasOutputParameter>\n <ewe:hasOutputParameter>\n <ewe:outputParameter>\n <dcterms:title>FirstAttachmentFilename</dcterms:title> \n <dcterms:description>The filename of the first file attachment (if any).</dcterms:description> \n <ewe:example>LadyTheDog.png</ewe:example> \n </ewe:outputParameter>\n </ewe:hasOutputParameter>\n <ewe:hasOutputParameter>\n <ewe:outputParameter>\n <dcterms:title>Label</dcterms:title> \n <dcterms:description>The Gmail label from trigger.</dcterms:description> \n <ewe:example>Work</ewe:example> \n </ewe:outputParameter>\n </ewe:hasOutputParameter>\n <ewe:hasOutputParameter>\n <ewe:outputParameter>\n <dcterms:title>ReceivedAt</dcterms:title> \n <dcterms:description>Date and time email was received.</dcterms:description> \n <ewe:example>August 23, 2010 at 11:01PM</ewe:example> \n </ewe:outputParameter>\n </ewe:hasOutputParameter>\n <ewe:hasInputParameter>\n <ewe:InputParameter>\n <dcterms:title>Label</dcterms:title> \n <xsd:type>string_value</xsd:type> \n </ewe:InputParameter>\n </ewe:hasInputParameter>\n </ewe:Event>\n \n <ewe:Event rdf:about=\"https://ifttt.com/channels/gmail/triggers/186\">\n <dcterms:title>New starred email</dcterms:title> \n <dcterms:description>This Trigger fires every time you add any new star to an email.</dcterms:description> \n <ewe:hasOutputParameter>\n <ewe:outputParameter>\n <dcterms:title>FromAddress</dcterms:title> \n <dcterms:description>Email address of sender.</dcterms:description> \n <ewe:example>somebody@gmail.com</ewe:example> \n </ewe:outputParameter>\n </ewe:hasOutputParameter>\n <ewe:hasOutputParameter>\n <ewe:outputParameter>\n <dcterms:title>Subject</dcterms:title> \n <dcterms:description>Email subject line.</dcterms:description> \n <ewe:example>Hello there</ewe:example> \n </ewe:outputParameter>\n </ewe:hasOutputParameter>\n <ewe:hasOutputParameter>\n <ewe:outputParameter>\n <dcterms:title>BodyPlain</dcterms:title> \n <dcterms:description>Plain text email body.</dcterms:description> \n <ewe:example>Been having a good day so far...</ewe:example> \n </ewe:outputParameter>\n </ewe:hasOutputParameter>\n <ewe:hasOutputParameter>\n <ewe:outputParameter>\n <dcterms:title>FirstAttachmentPrivateURL</dcterms:title> \n <dcterms:description>A URL to the first file attachment (if any) that only you can see.</dcterms:description> \n <ewe:example>https://locker.ifttt.com/f/29b08556-ac73-11e2-a707-22000a9730cf</ewe:example> \n </ewe:outputParameter>\n </ewe:hasOutputParameter>\n <ewe:hasOutputParameter>\n <ewe:outputParameter>\n <dcterms:title>FirstAttachmentPublicURL</dcterms:title> \n <dcterms:description>A URL to the first file attachment (if any) that anyone can see.</dcterms:description> \n <ewe:example>https://locker.ifttt.com/f/4bfc930c-ac73-11e2-b086-22000a9730cf</ewe:example> \n </ewe:outputParameter>\n </ewe:hasOutputParameter>\n <ewe:hasOutputParameter>\n <ewe:outputParameter>\n <dcterms:title>FirstAttachmentFilename</dcterms:title> \n <dcterms:description>The filename of the first file attachment (if any).</dcterms:description> \n <ewe:example>LadyTheDog.png</ewe:example> \n </ewe:outputParameter>\n </ewe:hasOutputParameter>\n <ewe:hasOutputParameter>\n <ewe:outputParameter>\n <dcterms:title>ReceivedAt</dcterms:title> \n <dcterms:description>Date and time email was received.</dcterms:description> \n <ewe:example>August 23, 2010 at 11:01PM</ewe:example> \n </ewe:outputParameter>\n </ewe:hasOutputParameter>\n </ewe:Event>\n \n \n <ewe:Event rdf:about=\"https://ifttt.com/channels/gmail/triggers/86\">\n <dcterms:title>New email from</dcterms:title> \n <dcterms:description>This Trigger fires every time a new email arrives in your inbox from theaddress you specify.</dcterms:description> \n <ewe:hasOutputParameter>\n <ewe:outputParameter>\n <dcterms:title>FromAddress</dcterms:title> \n <dcterms:description>Email address of sender.</dcterms:description> \n <ewe:example>somebody@gmail.com</ewe:example> \n </ewe:outputParameter>\n </ewe:hasOutputParameter>\n <ewe:hasOutputParameter>\n <ewe:outputParameter>\n <dcterms:title>Subject</dcterms:title> \n <dcterms:description>Email subject line.</dcterms:description> \n <ewe:example>Hello there</ewe:example> \n </ewe:outputParameter>\n </ewe:hasOutputParameter>\n <ewe:hasOutputParameter>\n <ewe:outputParameter>\n <dcterms:title>BodyPlain</dcterms:title> \n <dcterms:description>Plain text email body.</dcterms:description> \n <ewe:example>Been having a good day so far...</ewe:example> \n </ewe:outputParameter>\n </ewe:hasOutputParameter>\n <ewe:hasOutputParameter>\n <ewe:outputParameter>\n <dcterms:title>FirstAttachmentPrivateURL</dcterms:title> \n <dcterms:description>A URL to the first file attachment (if any) that only you can see.</dcterms:description> \n <ewe:example>https://locker.ifttt.com/f/29b08556-ac73-11e2-a707-22000a9730cf</ewe:example> \n </ewe:outputParameter>\n </ewe:hasOutputParameter>\n <ewe:hasOutputParameter>\n <ewe:outputParameter>\n <dcterms:title>FirstAttachmentPublicURL</dcterms:title> \n <dcterms:description>A URL to the first file attachment (if any) that anyone can see.</dcterms:description> \n <ewe:example>https://locker.ifttt.com/f/4bfc930c-ac73-11e2-b086-22000a9730cf</ewe:example> \n </ewe:outputParameter>\n </ewe:hasOutputParameter>\n <ewe:hasOutputParameter>\n <ewe:outputParameter>\n <dcterms:title>FirstAttachmentFilename</dcterms:title> \n <dcterms:description>The filename of the first file attachment (if any).</dcterms:description> \n <ewe:example>LadyTheDog.png</ewe:example> \n </ewe:outputParameter>\n </ewe:hasOutputParameter>\n <ewe:hasOutputParameter>\n <ewe:outputParameter>\n <dcterms:title>ReceivedAt</dcterms:title> \n <dcterms:description>Date and time email was received.</dcterms:description> \n <ewe:example>August 23, 2010 at 11:01PM</ewe:example> \n </ewe:outputParameter>\n </ewe:hasOutputParameter>\n <ewe:hasInputParameter>\n <ewe:InputParameter>\n <dcterms:title>Email address</dcterms:title> \n <xsd:type>string_value</xsd:type> \n </ewe:InputParameter>\n </ewe:hasInputParameter>\n </ewe:Event>\n \n <ewe:Event rdf:about=\"https://ifttt.com/channels/gmail/triggers/367\">\n <dcterms:title>Any new attachment</dcterms:title> \n <dcterms:description>This Trigger fires for every email attachment that arrives in your inbox.NOTE: Multiple attachments each fire separately.</dcterms:description> \n <ewe:hasOutputParameter>\n <ewe:outputParameter>\n <dcterms:title>FromAddress</dcterms:title> \n <dcterms:description>Email address of sender.</dcterms:description> \n <ewe:example>somebody@gmail.com</ewe:example> \n </ewe:outputParameter>\n </ewe:hasOutputParameter>\n <ewe:hasOutputParameter>\n <ewe:outputParameter>\n <dcterms:title>Subject</dcterms:title> \n <dcterms:description>Email subject line.</dcterms:description> \n <ewe:example>Hello there</ewe:example> \n </ewe:outputParameter>\n </ewe:hasOutputParameter>\n <ewe:hasOutputParameter>\n <ewe:outputParameter>\n <dcterms:title>BodyPlain</dcterms:title> \n <dcterms:description>Plain text email body.</dcterms:description> \n <ewe:example>Been having a good day so far...</ewe:example> \n </ewe:outputParameter>\n </ewe:hasOutputParameter>\n <ewe:hasOutputParameter>\n <ewe:outputParameter>\n <dcterms:title>AttachmentPrivateURL</dcterms:title> \n <dcterms:description>A URL to the file attachment that only you can see.</dcterms:description> \n <ewe:example>https://locker.ifttt.com/f/29b08556-ac73-11e2-a707-22000a9730cf</ewe:example> \n </ewe:outputParameter>\n </ewe:hasOutputParameter>\n <ewe:hasOutputParameter>\n <ewe:outputParameter>\n <dcterms:title>AttachmentPublicURL</dcterms:title> \n <dcterms:description>A URL to the file attachment that anyone can see.</dcterms:description> \n <ewe:example>https://locker.ifttt.com/f/4bfc930c-ac73-11e2-b086-22000a9730cf</ewe:example> \n </ewe:outputParameter>\n </ewe:hasOutputParameter>\n <ewe:hasOutputParameter>\n <ewe:outputParameter>\n <dcterms:title>AttachmentFilename</dcterms:title> \n <dcterms:description>The filename of the attachment.</dcterms:description> \n <ewe:example>LadyTheDog.png</ewe:example> \n </ewe:outputParameter>\n </ewe:hasOutputParameter>\n <ewe:hasOutputParameter>\n <ewe:outputParameter>\n <dcterms:title>ReceivedAt</dcterms:title> \n <dcterms:description>Date and time email was received.</dcterms:description> \n <ewe:example>August 23, 2010 at 11:01PM</ewe:example> \n </ewe:outputParameter>\n </ewe:hasOutputParameter>\n </ewe:Event>\n \n \n <ewe:Event rdf:about=\"https://ifttt.com/channels/gmail/triggers/185\">\n <dcterms:title>Any new email</dcterms:title> \n <dcterms:description>This Trigger fires every time any new email arrives in Gmail.</dcterms:description> \n <ewe:hasOutputParameter>\n <ewe:outputParameter>\n <dcterms:title>FromAddress</dcterms:title> \n <dcterms:description>Email address of sender.</dcterms:description> \n <ewe:example>somebody@gmail.com</ewe:example> \n </ewe:outputParameter>\n </ewe:hasOutputParameter>\n <ewe:hasOutputParameter>\n <ewe:outputParameter>\n <dcterms:title>Subject</dcterms:title> \n <dcterms:description>Email subject line.</dcterms:description> \n <ewe:example>Hello there</ewe:example> \n </ewe:outputParameter>\n </ewe:hasOutputParameter>\n <ewe:hasOutputParameter>\n <ewe:outputParameter>\n <dcterms:title>BodyPlain</dcterms:title> \n <dcterms:description>Plain text email body.</dcterms:description> \n <ewe:example>Been having a good day so far...</ewe:example> \n </ewe:outputParameter>\n </ewe:hasOutputParameter>\n <ewe:hasOutputParameter>\n <ewe:outputParameter>\n <dcterms:title>FirstAttachmentPrivateURL</dcterms:title> \n <dcterms:description>A URL to the first file attachment (if any) that only you can see.</dcterms:description> \n <ewe:example>https://locker.ifttt.com/f/29b08556-ac73-11e2-a707-22000a9730cf</ewe:example> \n </ewe:outputParameter>\n </ewe:hasOutputParameter>\n <ewe:hasOutputParameter>\n <ewe:outputParameter>\n <dcterms:title>FirstAttachmentPublicURL</dcterms:title> \n <dcterms:description>A URL to the first file attachment (if any) that anyone can see.</dcterms:description> \n <ewe:example>https://locker.ifttt.com/f/4bfc930c-ac73-11e2-b086-22000a9730cf</ewe:example> \n </ewe:outputParameter>\n </ewe:hasOutputParameter>\n <ewe:hasOutputParameter>\n <ewe:outputParameter>\n <dcterms:title>FirstAttachmentFilename</dcterms:title> \n <dcterms:description>The filename of the first file attachment (if any).</dcterms:description> \n <ewe:example>LadyTheDog.png</ewe:example> \n </ewe:outputParameter>\n </ewe:hasOutputParameter>\n <ewe:hasOutputParameter>\n <ewe:outputParameter>\n <dcterms:title>ReceivedAt</dcterms:title> \n <dcterms:description>Date and time email was received.</dcterms:description> \n <ewe:example>August 23, 2010 at 11:01PM</ewe:example> \n </ewe:outputParameter>\n </ewe:hasOutputParameter>\n </ewe:Event>\n \n <!-- Action Instances -->\n <ewe:Action rdf:about=\"https://ifttt.com/channels/gmail/actions/34\">\n <dcterms:title>Send an email</dcterms:title>\n <dcterms:description>This Action will send an email to a single recipient from your Gmail account.</dcterms:description>\n <ewe:hasInputParameter>\n <ewe:InputParameter>\n <dcterms:title>To address</dcterms:title>\n <dcterms:description>single email address only</dcterms:description> \n </ewe:InputParameter>\n </ewe:hasInputParameter>\n <ewe:hasInputParameter>\n <ewe:InputParameter>\n <dcterms:title>Subject</dcterms:title>\n </ewe:InputParameter>\n </ewe:hasInputParameter>\n <ewe:hasInputParameter>\n <ewe:InputParameter>\n <dcterms:title>Body</dcterms:title>\n <dcterms:description>some HTML ok</dcterms:description>\n </ewe:InputParameter>\n </ewe:hasInputParameter>\n <ewe:hasInputParameter>\n <ewe:InputParameter>\n <dcterms:title>Attachment URL</dcterms:title>\n <dcterms:description>URL to include as an attachment</dcterms:description>\n </ewe:InputParameter>\n </ewe:hasInputParameter>\n </ewe:Action>\n \n </rdf:RDF>\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": {}
|
|
}
|
|
]
|
|
}
|