rdfs:comment"A library of SWP elements for creating JSON text output."^^xsd:string;
owl:imports<http://uispin.org/ui>;
owl:versionInfo"0.1.0"^^xsd:string.
swon:Elements
rdf:typeui:NodeClass;
rdfs:comment"Abstract superclass of the JSON elements."^^xsd:string;
rdfs:label"JSON Elements"^^xsd:string;
rdfs:subClassOfui:Element;
spin:constraint
[rdf:typespl:Argument;
rdfs:comment"An option function that can be used to transform the values before they are inserted into the name-value pairs. A typical use case is to use ui:label."^^xsd:string;
spl:optional"true"^^xsd:boolean;
spl:predicatearg:labelFunction;
spl:valueTypespin:Function
];
ui:abstract"true"^^xsd:boolean.
swon:ForEachResultSetColumnIndex
rdf:typespin:SelectTemplate;
rdfs:label"For each result set column index"^^xsd:string;
rdfs:comment"The result set to get all column indices of."^^xsd:string;
spl:predicatearg:resultSet;
spl:valueTypesp:Select
].
swon:NameValuePair
rdf:typeui:NodeClass;
rdfs:label"Name value pair"^^xsd:string;
rdfs:subClassOfswon:Elements;
spin:constraint
[rdf:typespl:Argument;
rdfs:comment"The name of the variable."^^xsd:string;
spl:predicatearg:name;
spl:valueTypexsd:string
];
spin:constraint
[rdf:typespl:Argument;
rdfs:comment"The value (will be rendered as null if unbound)."^^xsd:string;
spl:optional"true"^^xsd:boolean;
spl:predicatearg:value
];
ui:prototype
[rdf:typeui:group;
ui:child
[rdf:typeui:TextNode;
ui:childIndex0;
ui:text"\""^^xsd:string
];
ui:child
[rdf:typeui:TextNode;
ui:childIndex1;
ui:text[sp:varName"name"^^xsd:string
]
];
ui:child
[rdf:typeui:TextNode;
ui:childIndex2;
ui:text"\":"^^xsd:string
];
ui:child
[rdf:typeui:if;
ui:child
[rdf:typeui:TextNode;
ui:childIndex0;
ui:text"\""^^xsd:string
];
ui:child
[rdf:typeui:TextNode;
ui:childIndex1;
ui:text[rdf:typeui:escapeJSON;
sp:arg1[rdf:typesp:if;
sp:arg1[rdf:typesp:bound;
sp:arg1[sp:varName"labelFunction"^^xsd:string
]
];
sp:arg2[rdf:typespif:invoke;
sp:arg1[sp:varName"labelFunction"^^xsd:string
];
sp:arg2[sp:varName"value"^^xsd:string
]
];
sp:arg3[rdf:typexsd:string;
sp:arg1[sp:varName"value"^^xsd:string
]
]
]
]
];
ui:child
[rdf:typeui:TextNode;
ui:childIndex2;
ui:text"\""^^xsd:string
];
ui:childIndex3;
ui:condition
[rdf:typesp:bound;
sp:arg1[sp:varName"value"^^xsd:string
]
]
];
ui:child
[rdf:typeui:else;
ui:child
[rdf:typeui:TextNode;
ui:childIndex0;
ui:text"null"^^xsd:string
];
ui:childIndex4
]
].
swon:RSArray
rdf:typeui:NodeClass;
rdfs:comment"Creates a simple JSON array with all values from the first column of a given result set, e.g. ['A','B','C']."^^xsd:string;
rdfs:label"RS Array"^^xsd:string;
rdfs:subClassOfswon:Elements;
spin:constraint
[rdf:typespl:Argument;
rdfs:comment"The result set to walk through."^^xsd:string;
spl:predicatearg:resultSet;
spl:valueTypesp:Select
];
ui:prototype
[rdf:typeui:call;
arg:resultSet
[sp:varName"resultSet"^^xsd:string
];
ui:child
[rdf:typeui:TextNode;
ui:childIndex0;
ui:text"["^^xsd:string
];
ui:child
[rdf:typeui:forEach;
ui:child
[rdf:typeui:group;
let:value
[rdf:typespr:cell;
sp:arg1[sp:varName"resultSet"^^xsd:string
];
sp:arg2[sp:varName"rowIndex"^^xsd:string
];
sp:arg30
];
ui:child
[rdf:typeui:TextNode;
ui:childIndex0;
ui:text"\""^^xsd:string
];
ui:child
[rdf:typeui:TextNode;
ui:childIndex1;
ui:text[rdf:typeui:escapeJSON;
sp:arg1[rdf:typesp:if;
sp:arg1[rdf:typesp:bound;
sp:arg1[sp:varName"labelFunction"^^xsd:string
]
];
sp:arg2[rdf:typespif:invoke;
sp:arg1[sp:varName"labelFunction"^^xsd:string
];
sp:arg2[sp:varName"value"^^xsd:string
]
];
sp:arg3[rdf:typexsd:string;
sp:arg1[sp:varName"value"^^xsd:string
]
]
]
]
];
ui:child
[rdf:typeui:TextNode;
ui:childIndex2;
ui:text"\""^^xsd:string
];
ui:childIndex0
];
ui:childIndex1;
ui:resultSet
[sp:varName"rs"^^xsd:string
];
ui:separator","^^xsd:string
];
ui:child
[rdf:typeui:TextNode;
ui:childIndex2;
ui:text"]"^^xsd:string
];
ui:templateswon:ForEachResultSetRowIndex
].
swon:RSObject
rdf:typeui:NodeClass;
rdfs:label"RS object"^^xsd:string;
rdfs:subClassOfswon:Elements;
spin:constraint
[rdf:typespl:Argument;
rdfs:comment"The result set containing the name-value pairs - the names are the result variables. If the optional row index isn't present, the system will use the first row."^^xsd:string;
spl:predicatearg:resultSet;
spl:valueTypesp:Select
];
spin:constraint
[rdf:typespl:Argument;
rdfs:comment"The (optional) row index to select the object."^^xsd:string;
spl:optional"true"^^xsd:boolean;
spl:predicatearg:rowIndex;
spl:valueTypexsd:integer
];
ui:prototype
[rdf:typeui:call;
arg:resultSet
[sp:varName"resultSet"^^xsd:string
];
ui:child
[rdf:typeui:TextNode;
ui:childIndex0;
ui:text"{"^^xsd:string
];
ui:child
[rdf:typeui:forEach;
ui:child
[rdf:typeswon:NameValuePair;
arg:labelFunction
[sp:varName"labelFunction"^^xsd:string
];
arg:name
[rdf:typespr:colName;
sp:arg1[sp:varName"resultSet"^^xsd:string
];
sp:arg2[sp:varName"colIndex"^^xsd:string
]
];
arg:value
[rdf:typespr:cell;
sp:arg1[sp:varName"resultSet"^^xsd:string
];
sp:arg2[rdf:typesp:coalesce;
sp:arg1[sp:varName"rowIndex"^^xsd:string
];
sp:arg20
];
sp:arg3[sp:varName"colIndex"^^xsd:string
]
];
ui:childIndex0
];
ui:childIndex1;
ui:resultSet
[sp:varName"rs"^^xsd:string
];
ui:separator","^^xsd:string
];
ui:child
[rdf:typeui:TextNode;
ui:childIndex2;
ui:text"}"^^xsd:string
];
ui:templateswon:ForEachResultSetColumnIndex
].
swon:RSObjectArray
rdf:typeui:NodeClass;
rdfs:comment"Creates a JSON array from a result set where each item is a swon:RSObject, with fields for each variable."^^xsd:string;
rdfs:label"RS object array"^^xsd:string;
rdfs:subClassOfswon:Elements;
spin:constraint
[rdf:typespl:Argument;
rdfs:comment"The result set delivering the rows."^^xsd:string;