kbss-cvut / s-pipes

Tool for execution of RDF-based pipelines.
GNU Lesser General Public License v3.0
4 stars 5 forks source link

Add missing parameters of functions in examples #213

Open blcham opened 1 year ago

blcham commented 1 year ago

Examples such as hello-world / skosify / .... are missing definitions of input parameters for main functions of scripts.

This is how definition of function parameters can look like:

e5x-enh:e5x-report-hint
  rdf:type sm:Function ;
  spin:constraint [
      rdf:type spl:Argument ;
      spl:defaultValue "ans" ;
      spl:optional "true"^^xsd:boolean ;
      spl:predicate e5x-enh:organizationName ;
      sm:next e5x-enh:bind-default-organization-type ;
      rdfs:comment "Name of organization for which hint should be generated." ;
    ] ;
  spin:constraint [
      rdf:type spl:Argument ;
      spl:defaultValue "false"^^xsd:boolean ;
      spl:optional "true"^^xsd:boolean ;
      spl:predicate e5x-enh:includeModelBasedJustifications ;
      spl:valueType xsd:boolean ;
      sm:next e5x-enh:bind-default-include-model-based-justifications-flag ;
      rdfs:comment "Include model based justifications in the output."^^xsd:string ;
    ] ;
  spin:constraint [
      rdf:type spl:Argument ;
      spl:defaultValue "true"^^xsd:boolean ;
      spl:optional "true"^^xsd:boolean ;
      spl:predicate e5x-enh:enableExpertKnowledge ;
      spl:valueType xsd:boolean ;
      sm:next e5x-enh:bind-default-enable-expert-knowledge-flag ;
      rdfs:comment "Use expert knowledge to generate hint."^^xsd:string ;
    ] ;
  spin:constraint [
      rdf:type spl:Argument ;
      spl:defaultValue "true"^^xsd:boolean ;
      spl:optional "true"^^xsd:boolean ;
      spl:predicate e5x-enh:enableLearning ;
      spl:valueType xsd:boolean ;
      sm:next e5x-enh:bindEnableLearningFlag ;
      rdfs:comment "Save service execution metadata in order to improve subsequent generations of hints. Note that the executed service will be affected by the metadata as well."^^xsd:string ;
    ] ;
  spin:constraint [
      rdf:type spl:Argument ;
      spl:defaultValue "true"^^xsd:boolean ;
      spl:optional "true"^^xsd:boolean ;
      spl:predicate e5x-enh:enableServiceHistory ;
      spl:valueType xsd:boolean ;
      sm:next e5x-enh:bindEnableServiceHistoryFlag ;
      rdfs:comment "Use service execution history to generate hint."^^xsd:string ;
    ] ;
  spin:constraint [
      rdf:type spl:Argument ;
      spl:defaultValue "true"^^xsd:boolean ;
      spl:optional "true"^^xsd:boolean ;
      spl:predicate e5x-enh:includeAnsweredQuestions ;
      spl:valueType xsd:boolean ;
      sm:next e5x-enh:bind-default-filter-out-answer-questions-flag ;
      rdfs:comment "If true e5x parts that are already filled in are returned. Otherwise, they are filtered out from the hint."^^xsd:string ;
    ] ;
  spin:constraint [
      rdf:type spl:Argument ;
      spl:defaultValue "true"^^xsd:boolean ;
      spl:optional "true"^^xsd:boolean ;
      spl:predicate e5x-enh:includeEccairsMetadata ;
      spl:valueType xsd:boolean ;
      sm:next e5x-enh:bind-default-include-eccairs-metadata-flag ;
      rdfs:comment "Include eccairs metadata in the output."^^xsd:string ;
    ] ;
  spin:constraint [
      rdf:type spl:Argument ;
      spl:defaultValue "true"^^xsd:boolean ;
      spl:optional "true"^^xsd:boolean ;
      spl:predicate e5x-enh:includeServiceHistoryStatistics ;
      spl:valueType xsd:boolean ;
      sm:next e5x-enh:bind-default-include-service-history-statistics ;
      rdfs:comment "Include service history statistics in the output."^^xsd:string ;
    ] ;
  spin:constraint [
      rdf:type spl:Argument ;
      spl:defaultValue "true"^^xsd:boolean ;
      spl:optional "true"^^xsd:boolean ;
      spl:predicate e5x-enh:includeTextualJustifications ;
      spl:valueType xsd:boolean ;
      sm:next e5x-enh:bind-default-include-textual-justifications-flag ;
      rdfs:comment "Include textual justifications in the output."^^xsd:string ;
    ] ;
  spin:constraint [
      rdf:type spl:Argument ;
      spl:optional "false"^^xsd:boolean ;
      spl:predicate e5x-enh:e5xResourceUri ;
      sm:next e5x-enh:bind-e5x-resource ;
      rdfs:comment "E5x content resource uri (e.g. http://onto.fel.cvut.cz/ontologies/resources/9d68843c-b569-11e6-80f5-76304dec7eb7 )." ;
    ] ;
  sm:returnModule e5x-enh:e5x-report-hint_Return ;
  rdfs:comment "Get e5x report hint." ;
  rdfs:subClassOf sm:Functions ;
.

A/C:

blcham commented 11 months ago

@rodionnv, please see how it was fixed for the hello-world example, try to fix it elsewhere and also test it in the editor, if it shows correctly.

blcham commented 1 month ago

@palagdan please add spin:constraints to other examples in ./doc directory. You find out that you implemented constraint correctly if you can get the correct dialog in SPipes Editor (see hello-world example for which spin:constraints are implemented): image

blcham commented 1 month ago

Reopen just to solve issues related to s-pipes-editor-ui.