@prefix : <http://purl.org/spar/pwo/> .
@prefix dc: <http://purl.org/dc/elements/1.1/> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix pwo: <http://purl.org/spar/pwo/> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix sit: <http://www.ontologydesignpatterns.org/cp/owl/situation.owl#> .
@prefix xml: <http://www.w3.org/XML/1998/namespace> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix owl2: <http://www.w3.org/2006/12/owl2#> .
@prefix part: <http://www.ontologydesignpatterns.org/cp/owl/participation.owl#> .
@prefix plan: <http://www.ontologydesignpatterns.org/cp/owl/basicplan.owl#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix swrl: <http://www.w3.org/2003/11/swrl#> .
@prefix time: <http://www.w3.org/2006/time#> .
@prefix cflow: <http://www.ontologydesignpatterns.org/cp/owl/controlflow.owl#> .
@prefix error: <http://www.essepuntato.it/2009/10/error/> .
@prefix swrlb: <http://www.w3.org/2003/11/swrlb#> .
@prefix swrlx: <http://www.w3.org/2003/11/swrlx#> .
@prefix tisit: <http://www.ontologydesignpatterns.org/cp/owl/timeindexedsituation.owl#> .
@prefix owlapi: <http://www.semanticweb.org/owlapi#> .
@prefix planex: <http://www.ontologydesignpatterns.org/cp/owl/basicplanexecution.owl#> .
@prefix taskex: <http://www.ontologydesignpatterns.org/cp/owl/taskexecution.owl#> .
@prefix timeint: <http://www.ontologydesignpatterns.org/cp/owl/timeinterval.owl#> .
@prefix plandesc: <http://www.ontologydesignpatterns.org/cp/owl/basicplandescription.owl#> .
@prefix sequence: <http://www.ontologydesignpatterns.org/cp/owl/sequence.owl#> .
@prefix parameter: <http://www.ontologydesignpatterns.org/cp/owl/parameter.owl#> .
@base <http://purl.org/spar/pwo> .

<http://purl.org/spar/pwo> rdf:type owl:Ontology ;
                           
                           owl:versionInfo "2.2"^^xsd:string ;
                           
                           dc:date "2015-06-18"^^xsd:string ;
                           
                           dc:creator "Aldo Gangemi"^^xsd:string ,
                                      "David Shotton"^^xsd:string ,
                                      "Silvio Peroni"^^xsd:string ;
                           
                           dc:title "The Publishing Workflow Ontology (PWO)"^^xsd:string ;
                           
                           dc:description "The Publishing Workflow Ontology (PWO) is a simple ontology written in OWL 2 DL for the characterization of the main stages in the workflow associated with the publication of a document (e.g. being written, under review, XML capture, page design, publication to the Web)."@en ;
                           
                           rdfs:comment "The Publishing Workflow Ontology (PWO) is an ontology for describing the workflow associated with the publication of a document.  It forms part of SPAR, a suite of Semantic Publishing and Referencing Ontologies."@en ;
                           
                           dc:rights "This work is distributed under a Creative Commons Attribution License (http://creativecommons.org/licenses/by/3.0/)."@en ;
                           
                           owl:imports <http://www.essepuntato.it/2009/10/error> ,
                                       <http://www.ontologydesignpatterns.org/cp/owl/basicplan.owl> ,
                                       <http://www.ontologydesignpatterns.org/cp/owl/controlflow.owl> ,
                                       <http://www.ontologydesignpatterns.org/cp/owl/participation.owl> ,
                                       <http://www.ontologydesignpatterns.org/cp/owl/sequence.owl> ,
                                       <http://www.ontologydesignpatterns.org/cp/owl/timeindexedsituation.owl> ,
                                       <http://www.ontologydesignpatterns.org/cp/owl/timeinterval.owl> ,
                                       <http://www.w3.org/2006/time> ;
                           
                           dc:description <https://svn.code.sf.net/p/sempublishing/code/PWO/pwo.png> .


#################################################################
#
#    Annotation properties
#
#################################################################


###  http://purl.org/dc/elements/1.1/contributor

dc:contributor rdf:type owl:AnnotationProperty .



###  http://purl.org/dc/elements/1.1/creator

dc:creator rdf:type owl:AnnotationProperty .



###  http://purl.org/dc/elements/1.1/date

dc:date rdf:type owl:AnnotationProperty .



###  http://purl.org/dc/elements/1.1/description

dc:description rdf:type owl:AnnotationProperty .



###  http://purl.org/dc/elements/1.1/rights

dc:rights rdf:type owl:AnnotationProperty .



###  http://purl.org/dc/elements/1.1/title

dc:title rdf:type owl:AnnotationProperty .



###  http://www.semanticweb.org/owlapi#nodeID

owlapi:nodeID rdf:type owl:AnnotationProperty .



###  http://www.w3.org/2000/01/rdf-schema#comment

rdfs:comment rdf:type owl:AnnotationProperty .



###  http://www.w3.org/2000/01/rdf-schema#label

rdfs:label rdf:type owl:AnnotationProperty .



###  http://www.w3.org/2002/07/owl#versionInfo

owl:versionInfo rdf:type owl:AnnotationProperty .





#################################################################
#
#    Object Properties
#
#################################################################


###  http://purl.org/spar/pwo/executes

:executes rdf:type owl:ObjectProperty ;
          
          rdfs:label "executes"@en ;
          
          rdfs:comment "This property allows to link a workflow execution to the related workflow description."@en ;
          
          owl:inverseOf :isExecutedBy ;
          
          rdfs:subPropertyOf plan:satisfies .



###  http://purl.org/spar/pwo/hasFirstStep

:hasFirstStep rdf:type owl:ObjectProperty ;
              
              rdfs:label "has first step"@en ;
              
              rdfs:comment "A workflow that starts with a particular step."@en ;
              
              rdfs:subPropertyOf :hasStep ;
              
              rdfs:range [ rdf:type owl:Class ;
                           owl:complementOf [ rdf:type owl:Restriction ;
                                              owl:onProperty :hasPreviousStep ;
                                              owl:someValuesFrom :Step
                                            ]
                         ] .



###  http://purl.org/spar/pwo/hasNextStep

:hasNextStep rdf:type owl:ObjectProperty ;
             
             rdfs:label "has next step"@en ;
             
             rdfs:comment "A property linking a step in a workflow with the step that directly follows it."@en ;
             
             rdfs:domain :Step ;
             
             rdfs:range :Step ;
             
             owl:inverseOf :hasPreviousStep ;
             
             rdfs:subPropertyOf sequence:directlyPrecedes .



###  http://purl.org/spar/pwo/hasPreviousStep

:hasPreviousStep rdf:type owl:ObjectProperty ;
                 
                 rdfs:label "has previous step"@en ;
                 
                 rdfs:comment "A property linking a step in a workflow with the step that directly precedes it."@en ;
                 
                 rdfs:subPropertyOf sequence:directlyFollows .



###  http://purl.org/spar/pwo/hasStep

:hasStep rdf:type owl:ObjectProperty ;
         
         rdfs:label "has step"@en ;
         
         rdfs:comment "The property linking a workflow to a component step."@en ;
         
         rdfs:range :Step ;
         
         rdfs:domain :Workflow ;
         
         rdfs:subPropertyOf plandesc:definesTask .



###  http://purl.org/spar/pwo/involvesAction

:involvesAction rdf:type owl:ObjectProperty ;
                
                rdfs:label "involves action"@en ;
                
                rdfs:comment "The property linking a step in a workflow or a particular execution of a workflow to an action."@en ;
                
                rdfs:range :Action ;
                
                owl:propertyChainAxiom ( :executes
                                         :hasStep
                                         :involvesAction
                                       ) ;
                
                rdfs:domain [ rdf:type owl:Class ;
                              owl:unionOf ( :Step
                                            :WorkflowExecution
                                          )
                            ] .



###  http://purl.org/spar/pwo/isActionInvolvedIn

:isActionInvolvedIn rdf:type owl:ObjectProperty ;
                    
                    rdfs:label "is action involved in step"@en ;
                    
                    rdfs:comment "The property linking an event to a step in a workflow or to a particular execution of a workflow description."@en ;
                    
                    owl:inverseOf :involvesAction ;
                    
                    owl:propertyChainAxiom ( :isActionInvolvedIn
                                             :isStepOf
                                             :isExecutedBy
                                           ) .



###  http://purl.org/spar/pwo/isExecutedBy

:isExecutedBy rdf:type owl:ObjectProperty ;
              
              rdfs:label "is executed by" ;
              
              rdfs:comment "This property allows to link a workflow description to the related workflow execution." ;
              
              rdfs:subPropertyOf plan:isSatisfiedBy .



###  http://purl.org/spar/pwo/isNeededBy

:isNeededBy rdf:type owl:ObjectProperty ;
            
            rdfs:label "is needed by"@en ;
            
            rdfs:comment "The property linking a thing required to undertake a workflow step to the step itself."@en ;
            
            owl:inverseOf :needs .



###  http://purl.org/spar/pwo/isProducedBy

:isProducedBy rdf:type owl:ObjectProperty ;
              
              rdfs:label "is produced by"@en ;
              
              rdfs:comment "The property linking something to the workflow step that produces, creates or results in that thing."@en ;
              
              owl:inverseOf :produces .



###  http://purl.org/spar/pwo/isStepOf

:isStepOf rdf:type owl:FunctionalProperty ,
                   owl:ObjectProperty ;
          
          rdfs:label "is step of"@en ;
          
          rdfs:comment "The property linking a step in a workflow to the workflow of which it is a component."@en ;
          
          owl:inverseOf :hasStep ;
          
          rdfs:subPropertyOf plandesc:isTaskDefinedIn .



###  http://purl.org/spar/pwo/needs

:needs rdf:type owl:ObjectProperty ;
       
       rdfs:label "needs"@en ;
       
       rdfs:comment "The property linking a workflow step to anything required to undertake that step."@en ;
       
       rdfs:domain :Step .



###  http://purl.org/spar/pwo/produces

:produces rdf:type owl:ObjectProperty ;
          
          rdfs:label "produces"@en ;
          
          rdfs:comment "The property linking a workflow step to the thing that the step produces, creates or results in."@en ;
          
          rdfs:domain :Step .



###  http://www.ontologydesignpatterns.org/cp/owl/basicplandescription.owl#definesTask

plandesc:definesTask rdf:type owl:ObjectProperty .



###  http://www.ontologydesignpatterns.org/cp/owl/basicplandescription.owl#isTaskDefinedIn

plandesc:isTaskDefinedIn rdf:type owl:ObjectProperty .



###  http://www.ontologydesignpatterns.org/cp/owl/participation.owl#hasParticipant

part:hasParticipant rdf:type owl:ObjectProperty .



###  http://www.ontologydesignpatterns.org/cp/owl/participation.owl#isParticipantIn

part:isParticipantIn rdf:type owl:ObjectProperty .



###  http://www.ontologydesignpatterns.org/cp/owl/sequence.owl#directlyFollows

sequence:directlyFollows rdf:type owl:ObjectProperty .



###  http://www.ontologydesignpatterns.org/cp/owl/sequence.owl#directlyPrecedes

sequence:directlyPrecedes rdf:type owl:ObjectProperty .



###  http://www.ontologydesignpatterns.org/cp/owl/sequence.owl#precedes

sequence:precedes rdf:type owl:ObjectProperty .



###  http://www.ontologydesignpatterns.org/cp/owl/situation.owl#isSettingFor

sit:isSettingFor rdf:type owl:ObjectProperty .



###  http://www.ontologydesignpatterns.org/cp/owl/taskexecution.owl#executesTask

taskex:executesTask rdf:type owl:ObjectProperty .



###  http://www.ontologydesignpatterns.org/cp/owl/taskexecution.owl#isExecutedIn

taskex:isExecutedIn rdf:type owl:ObjectProperty .



###  http://www.ontologydesignpatterns.org/cp/owl/timeindexedsituation.owl#atTime

tisit:atTime rdf:type owl:ObjectProperty ;
             
             rdfs:label "at time"@en ;
             
             rdfs:comment "A step is performed within a time interval."@en .



###  http://www.ontologydesignpatterns.org/cp/owl/timeindexedsituation.owl#forEntity

tisit:forEntity rdf:type owl:ObjectProperty .



###  http://www.ontologydesignpatterns.org/cp/owl/timeindexedsituation.owl#hasTimeIndexedSetting

tisit:hasTimeIndexedSetting rdf:type owl:ObjectProperty .





#################################################################
#
#    Data properties
#
#################################################################


###  http://www.essepuntato.it/2009/10/error/hasError

error:hasError rdf:type owl:DatatypeProperty .



###  http://www.ontologydesignpatterns.org/cp/owl/timeinterval.owl#hasIntervalDate

timeint:hasIntervalDate rdf:type owl:DatatypeProperty .





#################################################################
#
#    Classes
#
#################################################################


###  http://purl.org/spar/pwo/Action

:Action rdf:type owl:Class ;
        
        rdfs:label "action" ;
        
        rdfs:subClassOf [ rdf:type owl:Class ;
                          owl:intersectionOf ( planex:Action
                                               taskex:Action
                                               tisit:TimeIndexedSituation
                                             )
                        ] ;
        
        rdfs:comment "An event with at least one agent that is participant in it and that is linked to a workflow execution and to a step of the related workflow description." .



###  http://purl.org/spar/pwo/Step

:Step rdf:type owl:Class ;
      
      rdfs:label "step"@en ;
      
      rdfs:subClassOf <http://www.ontologydesignpatterns.org/cp/owl/taskrole.owl#Task> ,
                      [ rdf:type owl:Restriction ;
                        owl:onProperty parameter:hasParameter ;
                        owl:onClass time:DurationDescription ;
                        owl:qualifiedCardinality "1"^^xsd:nonNegativeInteger
                      ] ,
                      [ rdf:type owl:Restriction ;
                        owl:onProperty :involvesAction ;
                        owl:someValuesFrom :Action
                      ] ,
                      [ rdf:type owl:Restriction ;
                        owl:onProperty plandesc:isTaskDefinedIn ;
                        owl:allValuesFrom :Workflow
                      ] ;
      
      rdfs:comment "An atomic unit of a workflow, that may be characterized by a starting time and an ending time, and may be associated with one or more events.  A workflow step usually involves some input information, material or energy needed to complete the step, and some output information, material or energy produced by that step.  In the case of a publishing workflow, a step typically results in the creation of a publication entity, usually by the modification of another pre-existing publication entity, e.g. the creation of an edited paper from a rough draft, or of an HTML representation from an XML mark-up."@en .



###  http://purl.org/spar/pwo/Workflow

:Workflow rdf:type owl:Class ;
          
          rdfs:label "workflow"@en ;
          
          rdfs:subClassOf plandesc:Plan ,
                          [ rdf:type owl:Restriction ;
                            owl:onProperty :hasFirstStep ;
                            owl:someValuesFrom :Step
                          ] ;
          
          rdfs:comment "A sequence of connected steps, representing a sequence of publishing operations undertaken by agents. A workflow may be seen as an abstract model of real work."@en .



###  http://purl.org/spar/pwo/WorkflowExecution

:WorkflowExecution rdf:type owl:Class ;
                   
                   rdfs:subClassOf planex:PlanExecution ,
                                   tisit:TimeIndexedSituation ,
                                   [ rdf:type owl:Restriction ;
                                     owl:onProperty :executes ;
                                     owl:someValuesFrom :Workflow
                                   ] ,
                                   [ rdf:type owl:Restriction ;
                                     owl:onProperty :involvesAction ;
                                     owl:someValuesFrom [ rdf:type owl:Class ;
                                                          owl:intersectionOf ( :Action
                                                                               [ rdf:type owl:Restriction ;
                                                                                 owl:onProperty :isActionInvolvedIn ;
                                                                                 owl:someValuesFrom :Step
                                                                               ]
                                                                             )
                                                        ]
                                   ] .



###  http://www.ontologydesignpatterns.org/cp/owl/basicplanexecution.owl#PlanExecution

planex:PlanExecution rdf:type owl:Class .



###  http://www.ontologydesignpatterns.org/cp/owl/participation.owl#Event

part:Event rdf:type owl:Class .



###  http://www.ontologydesignpatterns.org/cp/owl/participation.owl#Object

part:Object rdf:type owl:Class .



###  http://www.ontologydesignpatterns.org/cp/owl/situation.owl#Situation

sit:Situation rdf:type owl:Class .



###  http://www.ontologydesignpatterns.org/cp/owl/taskexecution.owl#Action

taskex:Action rdf:type owl:Class .



###  http://www.ontologydesignpatterns.org/cp/owl/taskrole.owl#Task

<http://www.ontologydesignpatterns.org/cp/owl/taskrole.owl#Task> rdf:type owl:Class .



###  http://www.ontologydesignpatterns.org/cp/owl/timeindexedsituation.owl#TimeIndexedSituation

tisit:TimeIndexedSituation rdf:type owl:Class .



###  http://www.ontologydesignpatterns.org/cp/owl/timeinterval.owl#TimeInterval

timeint:TimeInterval rdf:type owl:Class .





#################################################################
#
#    Rules
#
#################################################################


<urn:swrl#si> rdf:type swrl:Variable .
<urn:swrl#sj> rdf:type swrl:Variable .
<urn:swrl#r> rdf:type swrl:Variable .
[ rdf:type swrl:Imp ;
  swrl:head [ rdf:type swrl:AtomList ;
              rdf:rest rdf:nil ;
              rdf:first [ rdf:type swrl:DatavaluedPropertyAtom ;
                          swrl:argument2 "A step cannot need a resource that will be produced by a following step"^^xsd:string ;
                          swrl:propertyPredicate error:hasError ;
                          swrl:argument1 <urn:swrl#si>
                        ]
            ] ;
  swrl:body [ rdf:type swrl:AtomList ;
              rdf:rest [ rdf:type swrl:AtomList ;
                         rdf:first [ rdf:type swrl:ClassAtom ;
                                     swrl:classPredicate :Step ;
                                     swrl:argument1 <urn:swrl#sj>
                                   ] ;
                         rdf:rest [ rdf:type swrl:AtomList ;
                                    rdf:rest [ rdf:type swrl:AtomList ;
                                               rdf:rest [ rdf:type swrl:AtomList ;
                                                          rdf:rest rdf:nil ;
                                                          rdf:first [ rdf:type swrl:IndividualPropertyAtom ;
                                                                      swrl:propertyPredicate sequence:precedes ;
                                                                      swrl:argument1 <urn:swrl#si> ;
                                                                      swrl:argument2 <urn:swrl#sj>
                                                                    ]
                                                        ] ;
                                               rdf:first [ rdf:type swrl:IndividualPropertyAtom ;
                                                           swrl:propertyPredicate :produces ;
                                                           swrl:argument2 <urn:swrl#r> ;
                                                           swrl:argument1 <urn:swrl#sj>
                                                         ]
                                             ] ;
                                    rdf:first [ rdf:type swrl:IndividualPropertyAtom ;
                                                swrl:propertyPredicate :needs ;
                                                swrl:argument2 <urn:swrl#r> ;
                                                swrl:argument1 <urn:swrl#si>
                                              ]
                                  ]
                       ] ;
              rdf:first [ rdf:type swrl:ClassAtom ;
                          swrl:classPredicate :Step ;
                          swrl:argument1 <urn:swrl#si>
                        ]
            ]
] .

###  Generated by the OWL API (version 3.5.0) http://owlapi.sourceforge.net

