Commit f762afd3 authored by Tobias Käfer's avatar Tobias Käfer
Browse files

cleanup

parent 93e75542
@prefix dct: <http://purl.org/dc/terms/> .
#
# A workflow description.
#
# Author: Tobias Käfer
#
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>.
@prefix http: <http://www.w3.org/2011/http#>.
@prefix http_m: <http://www.w3.org/2011/http-methods#>.
@prefix ldf: <http://ex.org/ldf#> .
@prefix ldp: <http://www.w3.org/ns/ldp#> .
@prefix log: <http://www.w3.org/2000/10/swap/log#>.
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix maths: <http://vocab.arvida.de/2014/03/maths/vocab#> .
@prefix qrl: <http://www.aifb.kit.edu/project/ld-retriever/qrl#>.
@prefix sparql-result: <http://www.w3.org/2005/sparql-results#> .
@prefix schema: <http://schema.org/> .
@prefix this: <http://this.nxparser.github.io/reference/to/URI/of/current/rdf/graph/for/representing/permanently/relative/URIs/in/N-Triples/#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix sp: <http://spinrdf.org/sp#> .
@prefix : <http://purl.org/wild/vocab#> .
@prefix speaker: <http://t2-speaker.lan:5001/#> . # PORT?
@prefix speaker: <http://tok450s.lan:5001/#> . # PORT?
# Prefixes for the components of the demo:
@prefix speaker: <http://t2-speaker.lan/#> .
@prefix weather: <http://weather-api.lan/#> .
@prefix light: <http://t2-ambient.lan/light#> .
@prefix rfid-smiley: <http://t2-rest-smiley.lan/#> .
@prefix rfid-frownie: <http://t2-rest-frownie.lan/#> .
<#wf> a :WorkflowModel ;
#
# The workflow model.
#
<#wfm> a :WorkflowModel ;
:hasBehaviour <#root> .
<#root> a :SequentialActivity ;
:hasChildActivities ( <#reset> <#greeting> <#weatherQuestion> <#weatherAnswerConditionalSplit> ) .
<#reset> a :AtomicActivity ;
:hasPostcondition <#truePostCondition> . # Whatever has to be done for reset, eg on the display
<#greeting> a :AtomicActivity ;
:hasPostcondition <#speakerQuiet> ;
#
# Atomic and composite activities.
#
<#root> a :SequentialActivity ;
:hasChildActivities ( <#darkness> <#weatherQuestion> <#weatherAnswerConditionalSplit> ) .
<#darkness> a :AtomicActivity ;
:hasPostcondition <#it-is-dark> ; # implicit waiting
:hasHttpRequest
[ a http:Request ;
http:mthd http_m:POST ; # Should be a PUT to the display
http:requestURI speaker:spk ;
http:body "{\"http://schema.org/text\":{\"@value\":\"Hello, user!\",\"@language\":\"en\"}}" ] , # TODO:generate string in a rule
[ a http:Request ;
http:mthd http_m:POST ;
http:mthd http_m:POST ;
http:requestURI speaker:spk ;
http:body "{\"http://schema.org/text\":{\"@value\":\"Hello, again!\",\"@language\":\"en\"}}" ] . # TODO:generate string in a rule
http:body "{\"http://schema.org/text\":{\"@value\":\"Hello, user! Please make it dark!\",\"@language\":\"en\"}}" ] .
<#weatherQuestion> a :AtomicActivity ;
:hasPostcondition <#speakerQuiet> ;
:hasPostcondition <#speakerQuiet> ;
:hasHttpRequest
[ a http:Request ;
http:mthd http_m:POST ; # Should be a PUT to the display
http:requestURI speaker:spk ;
http:body "{\"http://schema.org/text\":{\"@value\":\"Hello, user!\",\"@language\":\"en\"}}" ] , # TODO:generate string in a rule
[ a http:Request ;
http:mthd http_m:POST ;
http:requestURI speaker:spk ;
http:body "{\"http://schema.org/text\":{\"@value\":\"How is the weather at home?\",\"@language\":\"en\"}}" ] . # TODO:generate string in a rule
http:body "{\"http://schema.org/text\":{\"@value\":\"How is the weather at home?\",\"@language\":\"en\"}}" ] .
<#weatherAnswerConditionalSplit> a :ConditionalActivity ;
:hasChildActivities ( <#gameOver> <#dressDoll> ) .
:hasChildActivities ( <#well-done> <#oh-dear> ) .
<#gameOver> a :AtomicActivity ;
:hasPrecondition <#truePostCondition> ; # to be changed to something meaningful
<#well-done> a :AtomicActivity ;
:hasPrecondition <#good-good> , <#bad-bad> ; # one must be fulfilled, implicit waiting
:hasPostcondition <#speakerQuiet> ;
:hasHttpRequest
[ a http:Request ;
http:mthd http_m:POST ; # Should be a PUT to the display
http:requestURI speaker:spk ;
http:body "{\"http://schema.org/text\":{\"@value\":\"Hello, user!\",\"@language\":\"en\"}}" ] , # TODO:generate string in a rule
:hasHttpRequest
[ a http:Request ;
http:mthd http_m:POST ;
http:requestURI speaker:spk ;
http:body "{\"http://schema.org/text\":{\"@value\":\"Oh dear, you have no clue!\",\"@language\":\"en\"}}" ] . # TODO:generate string in a rule
http:body "{\"http://schema.org/text\":{\"@value\":\"Well Done!\",\"@language\":\"en\"}}" ] .
<#dressDoll> a :SequentialActivity ;
:hasChildActivities ( <#dollInstructions> <#dressing> ) .
<#dollInstructions> a :AtomicActivity ;
<#oh-dear> a :AtomicActivity ;
:hasPrecondition <#bad-good> , <#good-bad> ; # one must be fulfilled, implicit waiting
:hasPostcondition <#speakerQuiet> ;
:hasHttpRequest
[ a http:Request ;
http:mthd http_m:POST ; # Should be a PUT to the display
http:requestURI speaker:spk ;
http:body "{\"http://schema.org/text\":{\"@value\":\"Hello, user!\",\"@language\":\"en\"}}" ] , # TODO:generate string in a rule
[ a http:Request ;
http:mthd http_m:POST ;
http:requestURI speaker:spk ;
http:body "{\"http://schema.org/text\":{\"@value\":\"Dress the doll!\",\"@language\":\"en\"}}" ] . # TODO:generate string in a rule
http:body "{\"http://schema.org/text\":{\"@value\":\"Oh dear, you have no clue!\",\"@language\":\"en\"}}" ] .
<#dressing> a :AtomicActivity ;
:hasPostcondition <#truePostCondition> . # to be changed to something useful
#
# Pre- and Postconditions
#
<#speakerQuiet> a sp:Ask ;
sp:where ([
......@@ -95,4 +85,37 @@
sp:predicate <http://example.org/speaking> ;
sp:object "false"^^xsd:boolean ]) .
<#good-good> a sp:Ask ;
sp:where (
[ sp:subject rfid-frownie:sensor ;
sp:predicate rdf:value ;
sp:object "true"^^xsd:boolean ]
[ sp:subject weather:api ;
sp:predicate rdf:value ;
sp:object "good" ] ) .
<#bad-bad> a sp:Ask ;
sp:where (
[ sp:subject rfid:sensor ;
sp:predicate rdf:value ;
sp:object "bad" ]
[ sp:subject weather:api ;
sp:predicate rdf:value ;
sp:object "bad" ] ) .
<#good-bad> a sp:Ask ;
sp:where (
[ sp:subject rfid:sensor ;
sp:predicate rdf:value ;
sp:object "good" ]
[ sp:subject weather:api ;
sp:predicate rdf:value ;
sp:object "bad" ] ) .
<#bad-good> a sp:Ask ;
sp:where (
[ sp:subject rfid:sensor ;
sp:predicate rdf:value ;
sp:object "bad" ]
[ sp:subject weather:api ;
sp:predicate rdf:value ;
sp:object "good" ] ) .
<#truePostCondition> a sp:Ask ; sparql-result:boolean "true"^^xsd:boolean .
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment