Embed presentation
Downloaded 16 times








![Query with SPARQL9val queryStr = """select distinct ?Conceptwhere {[] a ?Concept} LIMIT 10"""val query = sparql(queryStr)query.serviceSelect("http://dbpedia.org/sparql").foreach{implicit qs=>println(res("Concept").getURI)}val f=Future(query.serviceSelect("http://es.dbpedia.org/sparql")).fallbackTo(Future(query.serviceSelect("http://dbpedia.org/sparql")))f.recover{case e=> println("Error "+e.getMessage)}f.map(_.foreach{implicit qs=>println(res("Concept").getValue)})Remote SPARQL endpointSimplified access toQuery solutionsFutures: asnyc executionNon blocking codeFallback alternative execution](/image.pl?url=https%3a%2f%2fimage.slidesharecdn.com%2fsemdev2015jpc-150531163243-lva1-app6891%2f75%2fScala-Programming-for-Semantic-Web-Developers-ESWC-Semdev2015-9-2048.jpg&f=jpg&w=240)


![RDF Streams: Actors12val sys=ActorSystem.create("system")val consumer=sys.actorOf(Props[RdfConsumer])class Streamer extends StreamRDF{override def triple(triple:Triple){consumer ! triple}}class RdfConsumer extends Actor{def receive= {case t:Triple =>if (t.predicateMatches(RDF.‘type‘))println(s"received triple $t")}RDF consumerActor receive methodImplements behaviorMessage-passing modelRDF producerAsync message passing](/image.pl?url=https%3a%2f%2fimage.slidesharecdn.com%2fsemdev2015jpc-150531163243-lva1-app6891%2f75%2fScala-Programming-for-Semantic-Web-Developers-ESWC-Semdev2015-12-2048.jpg&f=jpg&w=240)





Scalable and Reactive Programming for Semantic Web Developers discusses using Scala for semantic web development. Key points include:- Scala allows for more concise RDF code compared to Java through features like type inference and implicit parameters.- The actor model and futures in Scala enable asynchronous and reactive programming for RDF streams and SPARQL queries. - OWL API reasoning with ontologies can be done more clearly in Scala through implicit classes that simplify common operations.








![Query with SPARQL9val queryStr = """select distinct ?Conceptwhere {[] a ?Concept} LIMIT 10"""val query = sparql(queryStr)query.serviceSelect("http://dbpedia.org/sparql").foreach{implicit qs=>println(res("Concept").getURI)}val f=Future(query.serviceSelect("http://es.dbpedia.org/sparql")).fallbackTo(Future(query.serviceSelect("http://dbpedia.org/sparql")))f.recover{case e=> println("Error "+e.getMessage)}f.map(_.foreach{implicit qs=>println(res("Concept").getValue)})Remote SPARQL endpointSimplified access toQuery solutionsFutures: asnyc executionNon blocking codeFallback alternative execution](/image.pl?url=https%3a%2f%2fimage.slidesharecdn.com%2fsemdev2015jpc-150531163243-lva1-app6891%2f75%2fScala-Programming-for-Semantic-Web-Developers-ESWC-Semdev2015-9-2048.jpg&f=jpg&w=240)


![RDF Streams: Actors12val sys=ActorSystem.create("system")val consumer=sys.actorOf(Props[RdfConsumer])class Streamer extends StreamRDF{override def triple(triple:Triple){consumer ! triple}}class RdfConsumer extends Actor{def receive= {case t:Triple =>if (t.predicateMatches(RDF.‘type‘))println(s"received triple $t")}RDF consumerActor receive methodImplements behaviorMessage-passing modelRDF producerAsync message passing](/image.pl?url=https%3a%2f%2fimage.slidesharecdn.com%2fsemdev2015jpc-150531163243-lva1-app6891%2f75%2fScala-Programming-for-Semantic-Web-Developers-ESWC-Semdev2015-12-2048.jpg&f=jpg&w=240)



