[{"id":"ed95bc2f.901ac","type":"subflow","name":"triplesToVirtuoso","info":"","in":[{"x":176,"y":78,"wires":[{"id":"6313f766.86f138"}]}],"out":[{"x":817,"y":402,"wires":[{"id":"b7f3af7d.31a2c","port":0}]}]},{"id":"21d3dee6.0a31f2","type":"http request","z":"ed95bc2f.901ac","name":"","method":"GET","ret":"txt","url":"","tls":"","x":477,"y":82,"wires":[[]]},{"id":"6313f766.86f138","type":"function","z":"ed95bc2f.901ac","name":"prepare A1 and A2","func":"//var wwwAuth=msg.headers[\"www-authenticate\"];\n//var a = wwwAuth.split(\"\\\"\")\nvar realm=\"SPARQL\"; //a[1];\nmsg.nonce=\"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\"; //a[5].replace(\"a\",\"b\");\nmsg.opaque=\"aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa\"; //a[7];\nmsg.A1=msg.user+\":\"+realm+\":\"+msg.passw;\n//msg.uri=\"/sparql-graph-crud-auth?graph-uri=urn:graph\";\nmsg.uri=\"\"\nmsg.A2=msg.method+\":\"+msg.uri\nreturn msg;","outputs":1,"noerr":0,"x":506,"y":150,"wires":[["303fe384.7b709c"]]},{"id":"303fe384.7b709c","type":"md5","z":"ed95bc2f.901ac","name":"md5 A1","fieldToHash":"A1","fieldTypeToHash":"msg","hashField":"A1_md5","hashFieldType":"msg","x":473,"y":201,"wires":[["f45f5e3e.86df8"]]},{"id":"f45f5e3e.86df8","type":"md5","z":"ed95bc2f.901ac","name":"md5 A2","fieldToHash":"A2","fieldTypeToHash":"msg","hashField":"A2_md5","hashFieldType":"msg","x":470,"y":251,"wires":[["f368ed11.481c"]]},{"id":"f368ed11.481c","type":"function","z":"ed95bc2f.901ac","name":"prepare A3","func":"msg.A3=msg.A1_md5+\":\"+msg.nonce+\":\"+msg.A2_md5\nreturn msg;","outputs":1,"noerr":0,"x":477,"y":305,"wires":[["b751fb63.391298"]]},{"id":"b751fb63.391298","type":"md5","z":"ed95bc2f.901ac","name":"md5 A3","fieldToHash":"A3","fieldTypeToHash":"msg","hashField":"md5","hashFieldType":"msg","x":469,"y":359,"wires":[["727fdaab.7c1214"]]},{"id":"727fdaab.7c1214","type":"function","z":"ed95bc2f.901ac","name":"","func":"omsg = {};\nomsg.url=msg.url\nomsg.method=msg.method\nomsg.headers={};\nomsg.headers[\"Authorization\"]=\"Digest username=\\\"\"+msg.user+\"\\\", realm=\\\"SPARQL\\\", nonce=\\\"\"+msg.nonce+\"\\\", opaque=\\\"\"+msg.opaque+\"\\\", uri=\\\"\"+msg.uri+\"\\\", response=\\\"\"+msg.md5+\"\\\"\"\nomsg.payload=msg.triples\n\nreturn omsg;","outputs":1,"noerr":0,"x":457,"y":403,"wires":[["b7f3af7d.31a2c"]]},{"id":"b7f3af7d.31a2c","type":"http request","z":"ed95bc2f.901ac","name":"","method":"use","ret":"txt","url":"","tls":"","x":667,"y":402,"wires":[[]]},{"id":"b8726632.e08df8","type":"comment","z":"ed95bc2f.901ac","name":"implementing digest authentication","info":"Virtuoso supports only digest authentication \nand not basic authentication.\nBut in this version of nodered the http request \nsupports only basic authentication, this flow \nimplemnents the digest auth using the md5 node.","x":549,"y":33,"wires":[]},{"id":"500b9179.1f144","type":"tab","label":"Flow 1"},{"id":"a2dba8f0.09c688","type":"inject","z":"500b9179.1f144","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"x":149,"y":118,"wires":[["4fae1435.7c254c"]]},{"id":"cf83e3f5.a2158","type":"debug","z":"500b9179.1f144","name":"","active":true,"console":"false","complete":"true","x":991,"y":310,"wires":[]},{"id":"4792ca71.b8d664","type":"subflow:ed95bc2f.901ac","z":"500b9179.1f144","name":"","x":756,"y":311.5,"wires":[["cf83e3f5.a2158"]]},{"id":"4fae1435.7c254c","type":"function","z":"500b9179.1f144","name":"POST event","func":"msg.triples=' .\\n'+\n' \"Event_00001\" .\\n'+\n' \"\\\\\"Evento di esempio\\\\\"\"@it .\\n'+\n' \"Example\"@en .\\n'+\n' \"www.teatrodellapergola.com\" .\\n'+\n' \"2020-03-08\"^^ .\\n'+\n' \"2020-03-08\"^^ .\\n'+\n' \"10.00; 11.00; 12.00\" .\\n'+\n' \"NO\" .\\n'+\n' \"15-12Euro\" .\\n'+\n' \"TEATRO DELLA PERGOLA \" .\\n'+\n' \"43.9770\"^^ .\\n'+\n' \"11.2637\"^^ .\\n'+\n' \"POINT(11.2637 43.9770)\"^^ .\\n'+\n' \"VIA DELLA PERGOLA\" .\\n'+\n' \"12\" .\\n'+\n' \"Firenze\" .\\n'+\n' \"FI\" .\\n'+\n' \"333 2284784\" .\\n'+\n' \"Teatro\"@it .\\n'+\n' \"Theatre\"@en .\\n'+\n' \"nessuna descrizione\"@it .\\n'+\n' \"no description\"@en .\\n'+\n' \"INFO: 333 2284784\" .\\n'\n\nmsg.user=\"dba\"\nmsg.passw=\"dba\"\nmsg.method=\"POST\"\nmsg.url=\"http://virtuoso-kb:8890/sparql-graph-crud-auth?graph-uri=urn:graph:events\"\nreturn msg;","outputs":1,"noerr":0,"x":390,"y":116,"wires":[["4792ca71.b8d664"]]},{"id":"3e862429.88d32c","type":"function","z":"500b9179.1f144","name":"DELETE all events","func":"msg.triples=\"\"\nmsg.user=\"dba\"\nmsg.passw=\"dba\"\nmsg.method=\"DELETE\"\nmsg.url=\"http://virtuoso-kb:8890/sparql-graph-crud-auth?graph-uri=urn:graph:events\"\nreturn msg;","outputs":1,"noerr":0,"x":415,"y":185,"wires":[["4792ca71.b8d664"]]},{"id":"701000f1.6de26","type":"inject","z":"500b9179.1f144","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"x":140,"y":186,"wires":[["3e862429.88d32c"]]},{"id":"7d31b968.91f5f8","type":"function","z":"500b9179.1f144","name":"POST weather","func":"msg.triples=' .\\n'+\n' \"Roma\" .\\n'+\n' \"048017\" .\\n'+\n' .\\n'+\n\n' .\\n'+\n' .\\n'+\n' \"1582096973000\"^^ .\\n'+\n' \"2020-02-19T08:22:00.00+01:00\"^^ .\\n'+\n\n' .\\n'+\n' \"Rome1582096973000\" .\\n'+\n' \"13:41:00\"^^ .\\n'+\n' .\\n'+\n' \"12:29:00\"^^ .\\n'+\n' \"34.8\"^^ .\\n'+\n' \"07:09:00\"^^ .\\n'+\n' \"04:38:00\"^^ .\\n'+\n' \"17:49:00\"^^ .\\n'+\n' .\\n'+\n\n' \"2\"^^ .\\n'+\n' .\\n'+\n' \"giorno\" .\\n'+\n' \"0\"^^ .\\n'+\n' \"14\"^^ .\\n'+\n' \"8\"^^ .\\n'+\n' .\\n'+\n' \"pioggia e schiarite\" .\\n'+\n' \"Mercoledi\" .\\n'+\n\n' \"Mercoledi\" .\\n'+\n' \"9\"^^ .\\n'+\n' \"mattina\" .\\n'+\n' \"9\"^^ .\\n'+\n' .\\n'+\n' \"coperto\" .\\n'+\n' \"9999\"^^ .\\n'+\n' \"84\"^^ .\\n'+\n' \"variabile\" .\\n'+\n' .\\n'+\n\n' \"1400\"^^ .\\n'+\n' \"variabile\" .\\n'+\n' .\\n'+\n' \"14\"^^ .\\n'+\n' \"83\"^^ .\\n'+\n' \"pomeriggio\" .\\n'+\n' \"pioggia e schiarite\" .\\n'+\n' \"14\"^^ .\\n'+\n' .\\n'+\n' \"Mercoledi\" .\\n'+\n\n' .\\n'+\n' \"8\"^^ .\\n'+\n' \"sera\" .\\n'+\n' \"8\"^^ .\\n'+\n' .\\n'+\n' \"9999\"^^ .\\n'+\n' \"poco nuvoloso\" .\\n'+\n' \"Mercoledi\" .\\n'+\n' \"variabile\" .\\n'+\n' \"93\"^^ .\\n'+\n\n' \"15\"^^ .\\n'+\n' \"0\"^^ .\\n'+\n' \"Giovedi\" .\\n'+\n' .\\n'+\n' .\\n'+\n' \"3\"^^ .\\n'+\n' \"2\"^^ .\\n'+\n' \"sereno\" .\\n'+\n' \"giorno\" .\\n'+\n\n' \"sereno\" .\\n'+\n' .\\n'+\n' \"93\"^^ .\\n'+\n' \"2\"^^ .\\n'+\n' \"notte\" .\\n'+\n' \"variabile\" .\\n'+\n' .\\n'+\n' \"9999\"^^ .\\n'+\n' \"Giovedi\" .\\n'+\n' \"2\"^^ .\\n'+\n\n' \"8\"^^ .\\n'+\n' \"9999\"^^ .\\n'+\n' .\\n'+\n' .\\n'+\n' \"variabile\" .\\n'+\n' \"69\"^^ .\\n'+\n' \"sereno\" .\\n'+\n' \"Giovedi\" .\\n'+\n' \"mattina\" .\\n'+\n' \"8\"^^ .\\n'+\n\n' \"9999\"^^ .\\n'+\n' .\\n'+\n' \"Giovedi\" .\\n'+\n' \"sereno\" .\\n'+\n' \"15\"^^ .\\n'+\n' \"variabile\" .\\n'+\n' .\\n'+\n' \"15\"^^ .\\n'+\n' \"pomeriggio\" .\\n'+\n' \"39\"^^ .\\n'+\n\n' \"7\"^^ .\\n'+\n' \"9999\"^^ .\\n'+\n' \"variabile\" .\\n'+\n' \"71\"^^ .\\n'+\n' \"sereno\" .\\n'+\n' .\\n'+\n' \"sera\" .\\n'+\n' \"7\"^^ .\\n'+\n' \"Giovedi\" .\\n'+\n' .\\n'+\n' \"0\"^^ .\\n'+\n' \"3\"^^ .\\n'+\n' \"nuvoloso\" .\\n'+\n' \"giorno\" .\\n'+\n' \"0\"^^ .\\n'+\n' \"15\"^^ .\\n'+\n' .\\n'+\n' \"Venerdi\" .\\n'+\n' .\\n'+\n\n' \"0\"^^ .\\n'+\n' \"0\"^^ .\\n'+\n' \"sereno\" .\\n'+\n' .\\n'+\n' .\\n'+\n' \"Venerdi\" .\\n'+\n' \"notte\" .\\n'+\n' \"9999\"^^ .\\n'+\n' \"66\"^^ .\\n'+\n' \"variabile\" .\\n'+\n\n' \"nuvoloso\" .\\n'+\n' \"7\"^^ .\\n'+\n' \"62\"^^ .\\n'+\n' .\\n'+\n' \"mattina\" .\\n'+\n' \"variabile\" .\\n'+\n' \"Venerdi\" .\\n'+\n' \"7\"^^ .\\n'+\n' .\\n'+\n' \"9999\"^^ .\\n'+\n\n' \"poco nuvoloso\" .\\n'+\n' \"15\"^^ .\\n'+\n' \"58\"^^ .\\n'+\n' .\\n'+\n' \"Venerdi\" .\\n'+\n' \"variabile\" .\\n'+\n' \"9999\"^^ .\\n'+\n' \"15\"^^ .\\n'+\n' .\\n'+\n\n' \"pomeriggio\" .\\n'+\n' .\\n'+\n' \"90\"^^ .\\n'+\n' \"Venerdi\" .\\n'+\n' \"8\"^^ .\\n'+\n' \"sereno\" .\\n'+\n' \"8\"^^ .\\n'+\n' \"variabile\" .\\n'+\n' \"9999\"^^ .\\n'+\n' \"sera\" .\\n'+\n' .\\n'+\n\n' \"giorno\" .\\n'+\n' \"Sabato\" .\\n'+\n' \"sereno\" .\\n'+\n' \"variabile\" .\\n'+\n' .\\n'+\n' .\\n'+\n' \"nuvoloso\" .\\n'+\n' .\\n'+\n' \"Domenica\" .\\n'+\n' \"SO debole\" .\\n'+\n' \"giorno\" .\\n'+\n' .\\n'\n\nmsg.user=\"dba\"\nmsg.passw=\"dba\"\nmsg.method=\"POST\"\nmsg.url=\"http://virtuoso-kb:8890/sparql-graph-crud-auth?graph-uri=urn:graph:weather\"\nreturn msg;","outputs":1,"noerr":0,"x":405,"y":243,"wires":[["4792ca71.b8d664"]]},{"id":"b275ca35.66fa28","type":"inject","z":"500b9179.1f144","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"x":144,"y":244,"wires":[["7d31b968.91f5f8"]]},{"id":"7e28a790.583568","type":"function","z":"500b9179.1f144","name":"DELETE all weather","func":"msg.triples=\"\"\nmsg.user=\"dba\"\nmsg.passw=\"dba\"\nmsg.method=\"DELETE\"\nmsg.url=\"http://virtuoso-kb:8890/sparql-graph-crud-auth?graph-uri=urn:graph:weather\"\nreturn msg;","outputs":1,"noerr":0,"x":427,"y":370,"wires":[["4792ca71.b8d664"]]},{"id":"41b78059.7a2f9","type":"inject","z":"500b9179.1f144","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"x":139,"y":373,"wires":[["7e28a790.583568"]]},{"id":"7372e26f.f7121c","type":"function","z":"500b9179.1f144","name":"POST min weather","func":"msg.triples=' .\\n'+\n' \"Roma\" .\\n'+\n' .\\n'+\n\n' .\\n'+\n' .\\n'+\n' \"2020-02-19T08:22:00.00+01:00\"^^ .\\n'+\n\n' .\\n'+\n' .\\n'+\n\n' .\\n'+\n' \"giorno\" .\\n'+\n' \"14\"^^ .\\n'+\n' \"8\"^^ .\\n'+\n' .\\n'+\n' \"pioggia e schiarite\" .\\n'+\n' \"Mercoledi\" .\\n'+\n\n' \"15\"^^ .\\n'+\n' \"Giovedi\" .\\n'+\n' .\\n'+\n' .\\n'+\n' \"2\"^^ .\\n'+\n' \"sereno\" .\\n'+\n' \"giorno\" .\\n'+\n\n' \"0\"^^ .\\n'+\n' \"nuvoloso\" .\\n'+\n' \"giorno\" .\\n'+\n' \"15\"^^ .\\n'+\n' .\\n'+\n' \"Venerdi\" .\\n'+\n' .\\n'+\n\n' \"giorno\" .\\n'+\n' \"Sabato\" .\\n'+\n' \"sereno\" .\\n'+\n' .\\n'+\n' .\\n'+\n\n' \"nuvoloso\" .\\n'+\n' .\\n'+\n' \"Domenica\" .\\n'+\n' \"giorno\" .\\n'+\n' .\\n'\n\nmsg.user=\"dba\"\nmsg.passw=\"dba\"\nmsg.method=\"POST\"\nmsg.url=\"http://virtuoso-kb:8890/sparql-graph-crud-auth?graph-uri=urn:graph:weather\"\nreturn msg;","outputs":1,"noerr":0,"x":417,"y":310,"wires":[["4792ca71.b8d664"]]},{"id":"fbc557b.5f806a8","type":"inject","z":"500b9179.1f144","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"x":140,"y":309,"wires":[["7372e26f.f7121c"]]},{"id":"5e8dd7e6.6ae678","type":"function","z":"500b9179.1f144","name":"POST POI","func":"/*msg.triples=\n' .\\n'+\n' \"Hotel della Pergola\" .\\n'+\n' \"43.9771\"^^ .\\n'+\n' \"11.2638\"^^ .\\n'+\n' \"POINT(11.2638 43.9771)\"^^ .\\n'+\n' \"VIA DELLA PERGOLA\" .\\n'+\n' \"12\" .\\n'+\n' \"Florence\" .\\n'+\n' \"FI\" .\\n'+\n' \"055123456789\" .\\n'*/\nmsg.triples=\n'@prefix km4c: .\\n'+\n'@prefix schema: .\\n'+\n'@prefix geo: .\\n'+\n'@prefix xsd: .\\n'+\n'@prefix virtrdf: .\\n'+\n'@prefix dcterms: .\\n'+\n'@prefix skos: .\\n'+\n'@base .\\n' +\n\n' a km4c:Hotel ;\\n'+\n' schema:name \"Hotel della Pergola\" ;\\n'+\n' geo:lat \"43.9771\"^^xsd:float ;\\n'+\n' geo:long \"11.2638\"^^xsd:float ;\\n'+\n' geo:geometry \"POINT(11.2638 43.9771)\"^^virtrdf:Geometry ;\\n'+\n' schema:streetAddress \"VIA DELLA PERGOLA\" ;\\n'+\n' km4c:houseNumber \"12\" ;\\n'+\n' schema:addressLocality \"Florence\" ;\\n'+\n' schema:addressRegion \"FI\" ;\\n'+\n' schema:telephone \"055123456789\" ;\\n'+\n' schema:faxNumber \"055123456789\" ;\\n'+\n' schema:email \"me@email.org\" ;\\n'+\n' schema:url \"http://lapergolahotel.it/\" ;\\n'+\n' km4c:multimediaResource \"https://lapergolahotel.it/wp-content/uploads/2018/04/img-03-395x325.jpg\" ;\\n'+\n' dcterms:description \"a description of this point of interest\" ;\\n'+\n' skos:note \"a note of this point of interest\" .\\n'+\n\n' a km4c:Restaurant ;\\n'+\n' schema:name \"Ristorante della Pergola\" ;\\n'+\n' geo:lat \"43.9775\"^^xsd:float ;\\n'+\n' geo:long \"11.2633\"^^xsd:float ;\\n'+\n' geo:geometry \"POINT(11.2633 43.9775)\"^^virtrdf:Geometry ;\\n'+\n' schema:streetAddress \"VIA DELLA PERGOLA\" ;\\n'+\n' km4c:houseNumber \"12\" ;\\n'+\n' schema:addressLocality \"Florence\" ;\\n'+\n' schema:addressRegion \"FI\" ;\\n'+\n' schema:telephone \"055123456789\" .\\n'\n\nmsg.user=\"dba\"\nmsg.passw=\"dba\"\nmsg.method=\"POST\"\nmsg.url=\"http://virtuoso-kb:8890/sparql-graph-crud-auth?graph-uri=urn:graph:POIs\"\nreturn msg;","outputs":1,"noerr":0,"x":396,"y":439,"wires":[["4792ca71.b8d664"]]},{"id":"1fa4bc55.7df424","type":"inject","z":"500b9179.1f144","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"x":132,"y":440,"wires":[["5e8dd7e6.6ae678"]]},{"id":"9eabe8b7.94b768","type":"function","z":"500b9179.1f144","name":"DELETE all POI","func":"msg.triples=\"\"\nmsg.user=\"dba\"\nmsg.passw=\"dba\"\nmsg.method=\"DELETE\"\nmsg.url=\"http://virtuoso-kb:8890/sparql-graph-crud-auth?graph-uri=urn:graph:POIs\"\nreturn msg;","outputs":1,"noerr":0,"x":408,"y":505,"wires":[["4792ca71.b8d664"]]},{"id":"b42b13d4.80b27","type":"inject","z":"500b9179.1f144","name":"","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"x":140,"y":508,"wires":[["9eabe8b7.94b768"]]}]