Returns the value of e, as xsd:double.
Returns the local name of a URI resource. Based on splitting the IRI, not on any prefixes in the query or dataset. For example, the local name of http://test.com/my#Example is Example.
sp:arg1 (rdfs:Resource): the URI resource to get the local name of
|
Gets the max value of two numeric arguments.
sp:arg1 (rdfs:Literal): the first value to compare
|
sp:arg2 (rdfs:Literal): the second value to compare
|
Gets the min value of two numeric arguments.
sp:arg1 (rdfs:Literal): the first value to compare
|
sp:arg2 (rdfs:Literal): the second value to compare
|
Returns the namespace of a URI resource. Based on splitting the IRI, not on any prefixes in the query or dataset. For example, the namespace of http://test.com/my#Example is http://test.com/my#.
sp:arg1 (rdfs:Resource): the URI resource to get the namespace of
|
Gets the current time as xsd:dateTime. Actually, the time the query started. Constant throughout a query execution.
Returns the value of pi, as an xsd:double.
Computes the sha1sum of a given input value (?arg1).
sp:arg1: the value to get the sha1sum of
|
Make a string from the format string and the RDF terms.
sp:arg1 (xsd:string): The format
|
The square root of num.
sp:arg1 (rdfs:Literal): The number to get the square root of.
|
Extracts a substring, Java style using startIndex and endIndex.
sp:arg1 (xsd:string): the text to get a sub string of
|
sp:arg2 (xsd:integer): the index of the first character (text starts with index 0)
|
sp:arg3 (xsd:integer): [Optional] the index of the last character to include in the result
|
Returns the absolute value of the argument.
sp:arg1 (rdfs:Literal): the number to get the absolute value of
|
Gets the effective boolean value of an input node, for example 1 becomes true.
sp:arg1 (rdfs:Literal): The input value.
|
Returns the smallest integer value less than the argument (as a double).
sp:arg1 (rdfs:Literal): the number to get the ceiling of
|
Returns the concatenation of two (or more) strings.
sp:arg1 (xsd:string): the first string
|
sp:arg2 (xsd:string): the second string
|
Checks if a string (?arg1) contains a given sub-string (?arg2).
sp:arg1 (xsd:string): the (larger) string to search the substring in
|
sp:arg2 (xsd:string): the sub-string to search for
|
Test whether string ends with substr.
sp:arg1 (xsd:string): the (larger) text string to search in
|
sp:arg2 (xsd:string): the sub-string to search for
|
Returns the greatest integer value less than the argument (as a double).
sp:arg1 (rdfs:Literal): the number to get the floor of
|
Returns a string which is the lower case equivalent of the argument.
sp:arg1 (xsd:string): the string to convert to lower case
|
Performs string pattern matching based on regular expressions.
sp:arg1 (xsd:string): the string to search in
|
sp:arg2 (xsd:string): the pattern matching string
|
sp:arg3 (xsd:string): [Optional] the (optional) arguments for the regular expression matcher
|
Negates a boolean value.
sp:arg1 (rdfs:Literal): The input node.
|
Returns the nearest integer value to the argument.
sp:arg1 (rdfs:Literal): the number to round
|
Test whether a string (?arg1) starts with a sub-string (?arg2).
sp:arg1 (xsd:string): the (larger) string to search in
|
sp:arg2 (xsd:string): the sub-string to search for
|
Gets the length of a string (number of characters).
sp:arg1 (xsd:string): the text string to get the length of
|
Returns the substring of a string, given by a start index (integer) and, optionally, length. Absence of length means to end of string. Strings start from one, not zero as they do in Java and C#. 3rd argument is the length, like C# but unlike Java, where it is the endIndex.
sp:arg1 (xsd:string): the text to get a sub-string of
|
sp:arg2 (xsd:integer): the index of the first character (1 is the first character)
|
sp:arg3 (xsd:integer): [Optional] the (optional) number of characters to include in the substring
|
Returns a string which is the upper case equivalent of the argument.
sp:arg1 (xsd:string): the text to convert to upper-case
|
A magic property that can be used to walk through all applicable AssetFamilies for a WildCardAsset in the current TopBraid workspace. Example usage: ?wildcardAsset smf:applicableFamily ?family . An unbound variable is required on the right hand side. ?wildcardAsset can be bound to a wildcard asset which was returned from the smf:wildcardAsset magic property.
sp:arg1 (xsd:string): The wildcard asset that was returned using smf:wildcardAsset.
|
Takes the string of a phone number from a variety of formats, and an optional two-letter uppercase country code, and produces a "normalized" string using international conventions. Returns nothing if the phone number cannot be handled (use smf:isPhoneNumber beforehand).
sp:arg1 (xsd:string): The string to check.
|
sp:arg2 (xsd:string): [Optional] The default country code, as an upper-case two letter abbreviation.
|
Returns the base URI (resource) of a given file (?arg1), where the file is specified as a path string relative to the workspace root. This function might be used in conjunction with tops:files.
sp:arg1 (xsd:string): The path string, e.g. "/MyProject/MyFolder/MyFile.rdf".
|
Checks if a given graph can be read (by the current user).
sp:arg1 (rdfs:Resource): Graph base URI
|
Checks if a given graph can be modified (by the current user).
sp:arg1 (rdfs:Resource): Graph base URI
|
Checks if current user belongs to a named role.
arg:roleName (xsd:string): The name of the role to check.
|
Gets the value of a system configuration parameter from the dynamic config graph.
arg:param (xsd:string): The local name of the parameter property, e.g. "smtpServer" for <http://server.topbraidlive.org/web/2009/config#smtpServer>.
|
SELECT ?result WHERE { GRAPH <http://server.topbraidlive.org/dynamic/config> { BIND (IRI(CONCAT("http://server.topbraidlive.org/web/2009/config#", ?param)) AS ?predicate) . <http://server.topbraidlive.org/dynamic/config#configuration> ?predicate ?result . } . }
Converts the current RDF graph to text. Optionally the serialization of the RDF graph as text can be given. By default, the serialization is Turtle.
sp:arg1 (rdfs:Resource): [Optional] The optional serialization format of the output. By default, it is Turtle. This value should be an instance of "sml:RDFSerialization" from the sparqlmotionlib ontology, for example sml:RDFXML.
|
sp:arg2 (rdfs:Resource): [Optional] An optional pointer to the URI of a .context.json file - only used for JSON-LD.
|
Runs an nested SPARQL query and counts its results. Note that the nested query will reuse the variable bindings from its surrounding.
sp:arg1 (xsd:string): the SPARQL select query string to execute
|
Takes a SHACL shape and produces a Weka ARFF file as a string. The shape needs to declare sh:property constraints for each attribute. sh:maxCount 1 should be used for single-valued properties, otherwise the system will produce a new column/attribute for each value. The shape must declare a target, and all target nodes that conform to the shape will be turned into rows/instances in the ARFF file.
arg:shape (rdfs:Resource): The shape defining the ARFF.
|
Gets the base URI of the current TopBraid session, as a URI resource. The current session is the currently open domain model of TBE or TBC. If used in SPARQLMotion scripts, this function may return the script's URI itself if executed within TBC, but the TBE session if executed from TBE.
Gets a named attribute of the user that is currently logged into TopBraid. The attribute name must be present in the selected user management system (e.g. LDAP), and typical values include "company" and "mail".
arg:attributeName (xsd:string): The name of the attribute to get (e.g. "company").
|
Gets the name of the user that is currently logged into TopBraid. Should be preceeded by smf:hasCurrentUser to avoid exceptions.
Attempts to get a DBPedia page for a string. Returns false if no matching DBPedia page could be found.
sp:arg1 (xsd:string): the label to get a DBpedia resource for
|
smf:dbpedia("Dean Allemang")
smf:dbpedia("cycloyasi")
smf:dbpedia("Cyclone Yasi")
Returns the base URI of the ontology that the input resource is defined in. If the resource is defined in an unnamed graph (e.g., inference graph), then this function returns no value.
sp:arg1 (rdfs:Resource): The input resource
|
Returns the workspace file path of the ontology that the input resource is defined in, if it exists.
sp:arg1 (rdfs:Resource): The input resource
|
Constructs a new URI resource by concatenating a string constant {?arg2} to the URI of a given resource {?arg1}. Example: smf:deriveURI(owl:Thing, "-Child") = owl:Thing-Child
sp:arg1 (rdfs:Resource): the URI resource that constitutes the left part of the new URI
|
sp:arg2 (xsd:string): the additional string that will be appended to the right of {?arg1}
|
SELECT ?uri WHERE { BIND (smf:resource(fn:concat(xsd:string(?arg1), ?arg2)) AS ?uri) . }
Returns the duration between two dates in terms of one of the given "types". "type" is a string constant, which indicates the type of duration. It can be: String value - Explanation ms - milliseconds s - seconds m - minutes h - hours d - days mon - months y - years c - centuries
sp:arg1 (xsd:string): The type of the duration: It can be one of: "ms", "s", "m", "h", "d", "mon", "y", "c".
|
sp:arg2: The begin date
|
sp:arg3: The end date
|
Encodes a string so that it can be inserted into XML documents. Special characters will be converted.
sp:arg1 (xsd:string): The string to escape.
|
Gets the absolute path to the workspace file holding a given base URI (?arg1).
sp:arg1: The base URI - either as string or a URI resource.
|
Can be used to derive a "human-readable" label from a resource URI or local name. For example, with the input ex:firstName this will return "first name". The result can then be used in the rest of the SPARQL query, e.g. to create an rdfs:label.
sp:arg1: A URI resource or string literal that is used to generate a label. For URI resources, the local name will be used, the full string otherwise.
|
sp:arg2 (xsd:string): [Optional] An (optional) string template, that may include any of the following special commands:
- {date} inserts the current date
- {name} inserts the generated label
- {name:lower-case} inserts the label as lower case
- {name:upper-case} inserts the label as upper case
- {name:title-case} insert the label as title case
Any other characters will be inserted as they appear.
|
Attempts to convert a textual address (?arg1) into a comma-separated pair of lat/long values. The implementation currently uses the Google API (http://code.google.com/apis/maps/documentation/geocoding/) to do the actual work.
sp:arg1 (xsd:string): The address as a raw string, e.g. "1600 Amphitheatre Parkway, Mountain View, CA".
|
sp:arg2 (xsd:string): [Optional] An (optional) country code such as "au" to aid the search.
|
A magic property that can be used to walk through all available TBUsers for a permission group in the current TopBraid workspace. Example usage: ?group smf:groupHasUser ?user . An unbound variable is required on the right hand side. ?group can be bound to a permission group which was returned from the pg:group magic property.
sp:arg1 (xsd:string): The group to get the users of.
|
A magic property that can be used to walk through all available Assets and each Asset's AssetFamily for a project in the current TopBraid workspace. Example usage: ?project smf:hasAsset (?asset ?family) . A pair of unbound variables is required on the right hand side. ?project can be bound to a project which was returned from the smf:project magic property.
sp:arg1 (xsd:string): The project, e.g. retrieved using smf:project.
|
Checks if a given file (?arg1) is known to have a base URI in the current workspace, where the file is specified as a path string relative to the workspace root. This function might be used in conjunction with tops:files.
sp:arg1 (xsd:string): The path string, e.g. "/MyProject/MyFolder/MyFile.rdf".
|
Checks if there is a user that is currently logged into TopBraid.
Checks if there is any workspace file holding a given base URI (?arg1).
sp:arg1: The base URI - either as string or a URI resource.
|
Checks whether there are any "labels plugins" for a given blank node. In the TopBraid platform, labels plugins provide special rendering of certain blank nodes. For example, OWL restrictions are rendered in Manchester Syntax.
arg:node (rdfs:Resource): The (blank) node for which the test is performed.
|
Converts an input string to an HTML string - that is, special characters are converted.
sp:arg1 (xsd:string): the input string
|
A magic property that can be used to find missing or duplicate imports given a base URI if no base URI is supplied the function will traverse all projects finding any missing or duplicate imports. Example usage: ?projects smf:importGraphCheck ?results . or <http://baseUri/location> smf:importGraphCheck ?results . An unbound variable is required on the right hand side. ?projects can be assigned a base URI value if searching a specific graph.
sp:arg1 (xsd:string): The graph to search for missing or duplicate imports.
|
Checks whether the input expression evaluates to a bound variable. This is similar to the built-in bound function of SPARQL, but bound expects a variable as argument and therefore can not be used to evaluate arbitrary nested functions.
sp:arg1 (rdfs:Resource): the argument or variable to evaluate
|
Checks if a given graph is cached. TopBraid applies a cache over all database graphs.
arg:graph (rdfs:Resource): The graph (URI resource) to check.
|
Checks whether a given string is a domain name as specified by RFC1034/RFC1123 and according to the IANA-recognized list of top-level domains (TLDs). Returns nothing if the provided argument is not a literal.
arg:string (xsd:string): The string to validate.
|
Checks whether a given string is a valid Email address according to RFC 822 standards. Returns unbound if the given argument is not a literal.
arg:string (xsd:string): The string to validate.
|
Checks whether a given graph (contractually) only contains individuals, i.e. neither classes nor properties. This function does not actually look into the data, but currently assumes its result based on the following policies: In TBC-FE and SE, this always returns false. On the other platforms, it returns true for any graph under EVN/EDG teamwork control that is not an Ontology project (or of a similar asset type that declares teamwork:isOntologyProjectType=true. Note: For working copies or graphs containing the user name, this function will not work and needs to be called against the master graph instead.
arg:graphURI (rdfs:Resource): The URI of the graph to test.
|
Returns true if LDAP has been configured in the TBL server administration.
Checks whether a given string is a valid phone number, possibly in the context of a given default country code.
sp:arg1 (xsd:string): The string to check.
|
sp:arg2 (xsd:string): [Optional] The default country code, as an upper-case two letter abbreviation.
|
Checks whether the current working environment is TopBraid Live (stand-alone). False if we are in TopBraid Composer (including the personal server of Maestro Edition).
Checks whether a given string is a well-formed URL by checking the scheme, authority, path, query, and fragment in turn.
arg:string (xsd:string): The string to check.
|
Checks whether a given node represents a TopBraid user account (as produced by smf:userWithName).
arg:node: The node to check.
|
ASK WHERE { BIND (smf:userName(?node) AS ?userName) . FILTER bound(?userName) . }
Gets the time stamp of last modification of the file associated with a given graph from the workspace.
arg:graph: The URI of the graph to get the last modification of. May be a string or a URI resource.
|
Computes the Levenshtein Distance between two strings.
sp:arg1 (xsd:string): The first string.
|
sp:arg2 (xsd:string): The second string.
|
Gets the local range of a property at a class. The function first checks for locally defined owl:allValuesFrom restrictions on the class or its superclasses. If none is found, it will try to use the global rdfs:range of the property. If this does not exist either, it will return rdfs:Resource.
sp:arg1 (rdfs:Class): the class to get the local range at
|
sp:arg2 (rdf:Property): the property to get the range of
|
If there is an unbound variable on the right hand side then this magic property assigns it to all subjects with a URI from the base graph of the current query graph (i.e. excluding those defined in imported sub-graphs). If there is a specific URI on the right hand side, the magic property checks whether that URI is a subject in the base graph.
A magic property that can be used to query the available facets for 'Search the EDG' system index. *This function is only available in TBC-ME and web products.*
sp:arg1 (rdf:Property): The target property value.
|
sp:arg2 (xsd:integer): [Optional] The limit. If none provided the limit will default to 10.
|
sp:arg3 (xsd:string): [Optional] The query string expression.
|
sp:arg4 (rdfs:Resource): [Optional] The list of applied facet filters.
|
A magic property that can be used to query the 'Search the EDG' system index. *This function is only available in TBC-ME and web products.*
sp:arg1 (xsd:string): The query string expression.
|
sp:arg2 (rdfs:Resource): [Optional] A list of facet filters.
|
sp:arg3 (xsd:integer): [Optional] The offset. If none provided the offset will default to 0.
|
sp:arg4 (xsd:integer): [Optional] The limit. If none provided the limit default to 100.
|
A magic property that can be used to walk through all available Assets and AssetFamilies for an asset permission group in the current TopBraid workspace. Example usage: ?group smf:managedAssetsAndFamilies (?asset ?family) . A pair of unbound variables is required on the right hand side.
sp:arg1 (xsd:string): The name of a group to get the available assets and asset families for.
|
A magic property that can be used to walk through all available roles for an asset permission group in the current TopBraid workspace. Example usage: ?group smf:managedRole ?role . An unbound variable is required on the right hand side. ?group can be bound to a group which was returned from the smf:permissionGroup magic property.
sp:arg1 (xsd:string): The name of a group to get the roles of.
|
Gets the maximum cardinality of a property at a class. The function checks for locally defined owl:maxCardinality restrictions on the class or its superclasses. If none is found, it will check if the property is functional and, if so, return 1. Otherwise it will return -1.
sp:arg1 (rdfs:Class): the class to get the cardinality at
|
sp:arg2 (rdf:Property): the property to get the cardinality of
|
A magic property that can be used to walk through all available Asset Permission Groups for a role in the current TopBraid workspace. Example usage: ?role smf:memberOf ?group . An unbound variable is required on the right hand side. ?role can be bound to a role which was returned from the smf:role magic property.
sp:arg1 (xsd:string): The role to get the groups of.
|
Gets the minimum cardinality of a property at a class. The function checks for locally defined owl:minCardinality restrictions on the class or its superclasses. If none is found, it will return 0.
sp:arg1 (rdfs:Class): the class to get the minimum cardinality at
|
sp:arg2 (rdf:Property): the property to get the cardinality of
|
A magic property that can be used to walk through all available groups not currently associated with a specified role in the current TopBraid workspace. Example usage: ?role smf:notManagedBy ?group . An unbound variable is required on the right hand side. ?role can be bound to a role which was returned from the smf:role magic property.
sp:arg1 (xsd:string): The role to get the unassociated groups of.
|
Attempts to parse a string in OWL Manchester Syntax and returns an error string if something went wrong. Returns nothing (unbound) if the string could be parsed against the current query graph.
sp:arg1 (xsd:string): The string to parse.
|
A magic property that can be used to walk through all available Asset Permission Groups for the current TopBraid workspace. Example usage: () smf:permissionGroup ?group . An unbound variable is required on the right hand side.
A magic property that can be used to walk through all available Permissions for an Asset in a group in the current TopBraid workspace. Example usage: (?group ?assetId ?family) smf:permissionsForAsset ?permission or (?group ?assetId) smf:permissionsForAsset ?permission An unbound variable is required on the right hand side. If ?family is not specified, then the GRAPH asset family will be assumed.
sp:arg1 (xsd:string): The group to get the permissions for.
|
sp:arg2 (xsd:string): The asset to get the permissions of.
|
sp:arg3 (xsd:string): The asset family of the asset to get the permissions of.
|
Gets the prefix of a given resource (?arg1). Returns nothing if the argument is a URI that cannot be abbreviated with a prefix.
sp:arg1 (rdfs:Resource): The resource to get the prefix of.
|
SELECT ?prefix WHERE { BIND (smf:qname(?arg1) AS ?qname) . FILTER (!fn:starts-with(?qname, "<")) . BIND (smf:indexOf(?qname, ":") AS ?sep) . BIND (afn:substr(?qname, 0, ?sep) AS ?prefix) . }
A magic property that can be used to walk through all known projects for the current TopBraid workspace. Example usage: () smf:project ?project . An unbound variable is required on the right hand side.
Gets the qname of a resource, using the defined namespace abbreviations. In contrast to the official specs, this function will drop the : character if it's the first character in the string. If the resource does not have a suitable prefix abbreviation, the function will return the URI wrapped by <...>.
sp:arg1 (rdfs:Resource): the URI resource to get the qname of
|
Resets a given cached graph. This can be used to force a refresh of a TopBraid graph if the underlying database has been changed outside of TopBraid.
arg:graph (rdfs:Resource): The graph (URI resource) to reset.
|
A magic property that can be used to walk through all available Roles for the current TopBraid workspace. Example usage: () smf:role ?role . An unbound variable is required on the right hand side.
A magic property that can be used to walk through all available TBUsers for a role in the current TopBraid workspace. Example usage: ?role smf:roleHasUser ?user . An unbound variable is required on the right hand side. ?role can be bound to a role which was returned from the pg:role magic property.
sp:arg1 (xsd:string): The role to get the users of.
|
Takes a resource (usually a blank node) as argument and finds a URI resource that is the root of a blank node tree that contains the blank node. For example, if there is a blank node inside of a SPIN RDF structure that is linked to a class via spin:rule, then this function will return the class that points to the root of the SPIN RDF structure. Another example is OWL expressions such as owl:Restrictions.
sp:arg1 (rdfs:Resource): The resource to find the reference to.
|
Creates a new string literal with a given language from an existing value. For example, smf:setLanguage("House", "en") becomes "House"@en.
sp:arg1 (xsd:string): the text to set the language of
|
arg:language (xsd:string): the language of the result literal; may be empty to delete any existing language
|
Can be used to split a file into multiple sub-strings separated based on a delimiter from a start record to the end record. For example, ("/myProject/myfile.txt" "\\n" 1 10) smf:splitTextFile ?result will open the file with the given absolute path, split its content for every new line, and return the first 10 entries starting with first one. An unbound variable must be placed on the right hand side of this magic property.
sp:arg1 (xsd:string): The absolute path to the text file in the workspace (e.g., /myProject/myFolder/test.txt).
|
sp:arg2 (xsd:string): The delimiter string, for example "," for comma-separated lists.
|
sp:arg3 (xsd:integer): [Optional] The index of the first record to return, starting with 1.
|
sp:arg4 (xsd:integer): [Optional] The maximum number of records to return. May be left blank to get all entries.
|
Can be used to query all named subgraphs of a given (SDB) graph. For example, http://example.org/graph/mysub is a subgraph of http://example.org/graph. The magic property only works if the base graph is given.
sp:arg1 (rdfs:Resource): The base graph to get the subgraphs of.
|
Extracts a substring from an input string. This is similar to afn:substr but more robust against null values.
sp:arg1 (xsd:string): the input string
|
arg:fromIndex (xsd:integer): the start index (0 is the first character); if not bound, then the function will return null
|
arg:toIndex (xsd:integer): the end index; if not bound, use the length of text - 1
|
Same as smf:buildString, but with the side effect of printing the string into TopBraid's Error Log. This can be used as a debugging aid. The result of the function is the evaluated template. You can control the log level by prefixing the template string with either of the following: - "INFO:" will record an info item in the log (default) - "WARN:" will record a warning in the log - "ERROR:" will actually throw and report an exeception For example: smf:trace("WARN: The value of {?1} is invalid", -10) will log a warning "smf:trace: The value of -10 is invalid".
sp:arg1 (xsd:string): the template string to print
|
Returns the IRI of the subgraph that a given triple (subject, predicate, object) has been defined in. This is supported for graphs that are known to TopBraid's graph registry only, including union graphs such as those created with ui:graphWithImports.
sp:arg1 (rdfs:Resource): The subject of the triple.
|
sp:arg2 (rdf:Property): The predicate of the triple.
|
sp:arg3: The object of the triple.
|
Returns a Turtle (source code) representation of a given RDF node, using the prefixes from the current query graph. For blank nodes this includes depending triples, for URIs and literals just the single value rendering.
arg:resource: The RDF node to render into Turtle.
|
A magic property that can be used to walk through all available roles not currently associated with a specified asset permission group in the current TopBraid workspace. Example usage: ?group smf:unmanagedRole ?role . An unbound variable is required on the right hand side. ?group can be bound to a group which was returned from the smf:permissionGroup magic property.
sp:arg1 (xsd:string): The group to get the unavailable roles.
|
A magic property that can be used to walk through all available users in the current TopBraid workspace. Example usage: () smf:user ?user . An unbound variable is required on the right hand side.
Gets the display name of a user with a given URI (of the form urn:x-tb-users:XY). Note that the result of this can not necessarily be used as input to smf:userwithName, because the display name may be different from the internal user name.
arg:user (rdfs:Resource): The URI node of the user.
|
Gets the email address associated with a user with a given URI (of the form urn:x-tb-users:XY). This could be retrieved from the LDAP directory, or from any property with local name "email" in the users.ttl file, or from the property edg:email in the active query graph.
arg:user (rdfs:Resource): The URI node of the user.
|
Converts a user URI resource into a user name. Returns nothing if the given node is not a URI that follows the URI naming pattern used by TopBraid. The inverse function is smf:userWithName.
sp:arg1 (rdfs:Resource): The user resource to convert to a name.
|
This magic property requires a user resource on the left hand and an unbound variable on the right. This variable will contain the URIs of the security roles (e.g. LDAP) that the given user is known to have.
sp:arg1 (rdfs:Resource): The user resource.
|
Converts a user name into a URI resource, following the default settings in TopBraid. Often used in conjunction with smf:currentUserName(). The inverse function is smf:userName.
sp:arg1 (xsd:string): The user name to convert to a resource.
|
Gets the keys of all Weka classifiers that are currently on the configured Maui server. Usually they will have been created using sml:CreateWekaClassifier, but they may still be around from a previous run of a TopBraid product. The magic property takes nothing on the left hand side and needs an unbound variable on the right hand side, e.g. () smf:wekaClassifiers ?key .
Classifies a given resource via Weka. The classifier must be executing on the configured Maui server, typically created in a previous step using sml:CreateWekaClassifier. This function here uses the trained Weka classifier to produce a suggestion for the property/path that has been specified when the classifier was created.
arg:key (xsd:string): The key of the Weka classifier. Must be the same as the sml:key used in sml:CreateWekaClassifier.
|
arg:resource (rdfs:Resource): The resource to classify.
|
arg:shape (rdfs:Resource): The shape defining which properties/paths have to be sent to the Weka engine.
|
A magic property that can be used to walk through all available WildCardAssets for the current TopBraid workspace. Example usage: () smf:wildcardAsset (?wildcardAsset ?family) A pair of unbound variables is required on the right hand side.
Gets the absolute path of the workspace in the local hard disk.
Constructs a new string by inserting the existing variable bindings into a template. The template can mention variable names in curly braces, such as "Hello {?index}" would create "Hello 42" is ?index has the value 42. As an alternative to variable names, the function can take additional arguments after the template, the variables of which can be accessed using {?1}, {?2} etc. For example: smf:buildString("Hello-{?1}-{?2}", ?day, ?month) would insert day and month at places {?1} and {?2}.
sp:arg1 (xsd:string): the template string
|
Builds a string from the members of a given rdf:List (?arg1). The function iterates over all members of the list (which must be well-formed according to the RDF syntax rules). For each member, a string template (?arg2) is applied where the expression {?member} will be substituted with the current member. Optionally, a separator (?arg3) can be inserted between the list members in the result string, e.g. to insert a comma.
sp:arg1 (rdf:List): the head of the rdf:List to convert to string
|
sp:arg2 (xsd:string): the template string
|
sp:arg3 (xsd:string): [Optional] the separator to insert between each string
|
Constructs a new URI resource by inserting the existing variable bindings into a template. The template can mention variable names in curly braces, such as "my:Instance-{?index}" would create "my:Instance-42" is ?index has the value 42. As an alternative to variable names, the function can take additional arguments after the template, the variables of which can be accessed using {?1}, {?2} etc. For example: smf:buildURI("my:Instance-{?1}-{?2}", ?day, ?month) would insert day and month at places {?1} and {?2}.
sp:arg1 (xsd:string): The URI template such as "<http://my.com/Instance-{?index}>". If the template contains a full URI, then it must be wrapped by <...>, otherwise the system will treat it as a qname.
|
A variation of smf:buildURI that also makes sure that the created URI is unique in the current graph (that is, no triple contains the URI as either subject, predicate or object). This function is particularly useful for ontology mapping from a legacy data source into an RDF model.
sp:arg1 (xsd:string): The URI template such as "<http://my.com/Instance-{?index}>". If the template contains a full URI, then it must be wrapped by <...>, otherwise the system will treat it as a qname.
|
Converts an input string into camel case. For example, "semantic web" becomes "SemanticWeb". An optional matching expression can be given to only convert the matched characters.
sp:arg1 (xsd:string): the input string
|
sp:arg2 (xsd:string): [Optional] The match expression
|
Checks whether a given SPIN function (?arg1) can be invoked with a given list of argument (?arg2, ?arg3, ...) without violating any of its declared SPIN constraints. In addition to the usual argument declarations, the SPIN function may declare ASK and CONSTRUCT queries to check additional pre-conditions.
sp:arg1 (spin:Function): The function to check.
|
sp:arg2: [Optional] The first argument of the function call.
|
sp:arg3: [Optional] The second argument of the function call.
|
sp:arg4: [Optional] The third argument of the function call.
|
sp:arg5: [Optional] The forth argument of the function call.
|
Creates a new literal from an existing literal, but with a different datatype. This can, for example, be used to convert between floating point values and int values.
sp:arg1 (rdfs:Literal): the "old" literal that shall be converted
|
arg:datatype (rdfs:Datatype): [Optional] The target datatype, e.g. xsd:integer. Leave blank for untyped literals.
|
Takes a string and checks whether it would be a valid regular expression. Returns unbound if OK, or a string with an error message otherwise.
arg:regex (xsd:string): The potential regular expression to check.
|
Converts a SPARQL query encoded in SPIN RDF format to a SPARQL string in textual form. The SPIN query must be well-formed in the context graph at execution time, and the provided argument must be the root of the expression (e.g., an instance of sp:Select). This function is available as part of the TopBraid SPIN Libraries.
sp:arg1 (sp:Query): the root of the SPIN RDF query
|
sp:arg2 (xsd:boolean): [Optional] true to embed HTML markup into the output
|
Counts all occurrences of a triple pattern based on subject (?arg1), predicate (?arg2) and object (?arg3) input. Any of those can be unbound variables. This function is available as part of the TopBraid SPIN Libraries.
sp:arg1 (rdfs:Resource): the subject in the match triple, or an unbound variable for a wildcard
|
sp:arg2 (rdf:Property): the predicate in the match triple, or an unbound variable for a wildcard
|
sp:arg3: the object in the match triple, or an unbound variable for a wildcard
|
Given a predicate and an object, this function computes the number of matches using SELECT (COUNT(DISTINCT ?object) AS ?result) WHERE { ?subject ?predicate* ?object . } The main purpose of this function is to optimize performance - this direction of * traversal is currently very slow in Jena. The function can be used to compute the number of superclasses of a given class.
sp:arg1 (rdf:Property): The predicate to walk.
|
sp:arg2 (rdfs:Resource): The object to start traversal at.
|
Given a predicate and an object, this function computes the number of matches using SELECT (COUNT(DISTINCT ?subject) AS ?result) WHERE { ?subject ?predicate* ?object . } The main purpose of this function is to optimize performance - this direction of * traversal is currently very slow in Jena. The function can be used to compute the number of subclasses of a given class.
sp:arg1 (rdf:Property): The predicate to walk.
|
sp:arg2 (rdfs:Resource): The object to start traversal at.
|
Returns the current time in milliseconds. See System.currentTimeMillis() in Java.
Takes a date/time literal and a pattern and renders the date according to the pattern. This is a reverse of spif:parseDate and uses the same format.
arg:date: An xsd:date, xsd:dateTime or xsd:time literal containing the date and time to render.
|
arg:pattern (xsd:string): The output pattern.
|
spif:dateFormat("2008-02-13"^^xsd:date, "MMMMMMMMM dd, yyyy")
spif:dateFormat("01:02:03"^^xsd:time, "hh::mm")
Takes a number as its first argument and applies a given formatting string to it, for example, to convert a floating point into a number that has exactly two decimal places after the dot. For example, spif:decimalFormat(12.3456, "#.##") returns "12.35". The resulting string can then by cast back to a number, e.g. using xsd:double(?str).
arg:number (xsd:decimal): The number to format.
|
arg:pattern (xsd:string): The pattern, following the syntax defined for the Java DecimalFormat class (see: http://download.oracle.com/javase/6/docs/api/java/text/DecimalFormat.html).
|
spif:decimalFormat(12.3456, "#.##")
Decodes a URL string - this is the inverse operation of spif:encodeURL.
sp:arg1 (xsd:string): The URL to decode.
|
sp:arg2 (xsd:string): [Optional] The (optional) encoding. Defaults to UTF-8.
|
Encodes a URL string, for example so that it can be passed as an argument to REST services.
sp:arg1 (xsd:string): The URL to encode.
|
sp:arg2 (xsd:string): [Optional] The (optional) encoding. Defaults to UTF-8.
|
Takes a starting node (?arg1) and a SPARQL path expression (?arg2) and binds all matching results of the path evaluation. Also supports cases where the starting node is unbound, even both unbound.
sp:arg1 (rdfs:Resource): The start node.
|
sp:arg2: The path expression, as a parsable string, or a IRI resource for a simple path consisting of a single property only.
|
Can be used to iterate over a range of (integer) numbers similar to a for loop in iterative programming languages. An unbound variable must be placed on the left side of this magic property. On the right side, a list of two numbers needs to be placed. For example, ?index spif:for (1 10) binds ?index to all xsd:integers >= 1 and <= 10. By default it will add +1 to each step. It is possible to walk different steps and direction by specifying a third argument on the right, e.g. ?index spif:for (10 1 -1) will walk from 10 to 1 backwards.
Can be used to "iterate" over a list of RDF nodes given as members of a list on the right. An unbound variable must be on the left side of the magic property. On the right side, a list of nodes with arbitrary length can be placed. For example, ?subject spif:foreach (owl:Thing owl:Nothing) will bind ?subject to owl:Thing and then owl:Nothing.
Constructs a human-readable label for a URI resource by taking everything after the last '/' or the last '#' as starting point.
sp:arg1 (rdfs:Resource): The resource to generate a label for.
|
SELECT ?label WHERE { BIND (spif:localName(?arg1) AS ?localName) . BIND (spif:unCamelCase(?localName) AS ?label) . }
spif:generateLabel(<http://example.org/test#LocalName>)
spif:generateLabel(<http://example.org/test/123>)
Generates a new unique ID as a string literal. This is often useful for creating "random" URIs and other identifiers.
Checks whether a given graph URI is known to the dataset. This also returns true for graphs that are empty.
arg:graph (rdfs:Resource): The graph (IRI) to test.
|
Checks whether the current query graph is isomorphic with a given named graph. This compares all triples in the graphs, matching equivalent blank node structures even if they have different internal identities.
arg:graph (rdfs:Resource): The graph to compare the current query graph with.
|
Counts the number of triples in the current query graph and returns that sum as an xsd:integer.
Checks whether a given subject/predicate combination has all values enumerated from a given rdf:List. In other words, for each member ?object of the rdf:List, the triple (?arg1, ?arg2, ?object) must be in the model to return true. If the list is empty, true will also be returned.
sp:arg1 (rdfs:Resource): the match subject
|
sp:arg2 (rdf:Property): the match predicate
|
sp:arg3 (rdf:List): an rdf:List containing the match objects
|
Gets the index of the first occurrence of a certain substring in a given search string. Returns an error if the substring is not found.
sp:arg1 (xsd:string): the string to search in
|
sp:arg2 (xsd:string): the sub string to search for
|
sp:arg3 (xsd:integer): [Optional] The optional index to start with.
|
Calls another SPARQL function specified by a URI resource (?arg1), with any number of additional arguments to be passed into the function (?arg2, ?arg3, ...). The result of the function call will be returned as result of the invoke call. This can be used to dynamically call functions when their URI is not known statically. The function can also be a binary built-in SPARQL function using the SPIN function identifiers from the SPL ontology. For example, sp:gt will be executed as ?left > ?right.
sp:arg1 (spin:Function): The URI resource defining the function to call.
|
sp:arg2: [Optional] The first argument of the function call.
|
sp:arg3: [Optional] The second argument of the function call.
|
sp:arg4: [Optional] The third argument of the function call.
|
sp:arg5: [Optional] The forth argument of the function call.
|
Checks whether a given triple is read-only, that is, cannot be deleted. Triples that are in the system ontology are generally not deletable. TopBraid also enforces that on union graphs, all triples that are not from the base graph of the union are read-only. Other platforms may have different privilege rules for this function.
sp:arg1 (rdfs:Resource): The subject of the triple to delete.
|
sp:arg2 (rdf:Property): The predicate of the triple to delete.
|
sp:arg3: The object of the triple to delete.
|
Checks whether the lexical form of a given data literal would be a valid value for a given datatype.
arg:data: The data node.
|
arg:datatype (rdfs:Datatype): The XSD datatype to test against.
|
Checks whether a given string is a valid language tag.
sp:arg1 (xsd:string): The string to check.
|
Checks whether a given input string is a well-formed absolute URI. This can be used to validate user input before it is turned into a URI resource.
sp:arg1 (xsd:string): The string to validate.
|
Takes a Template and splits its spin:labelTemplate into an iteration over string constants or properties. The properties align with the spl:predicates of the declared spl:Arguments of the template. Among others, this magic property can be used to render template calls into user interface components.
sp:arg1 (spin:Template): The template to get the label segments of.
|
Gets the index of the last occurrence of a certain substring in a given search string. Returns an error if the substring is not found.
sp:arg1 (xsd:string): the string to search in
|
sp:arg2 (xsd:string): the sub string to search for
|
sp:arg3 (xsd:integer): [Optional] The optional index to start with.
|
Gets a "local name" from a URI resource. This takes everything after the last '/' or '#' character of the URI. This function is a more intuitive alternative to afn:localname, which strictly follows the W3C namespace splitting algorithm that often leads to surprising results.
sp:arg1 (rdfs:Resource): The URI resource to get the local name of.
|
SELECT ?localName WHERE { BIND (xsd:string(?arg1) AS ?uri) . BIND (spif:lastIndexOf(?uri, "/") AS ?slash) . BIND (spif:lastIndexOf(?uri, "#") AS ?hash) . BIND (IF(((!bound(?hash)) || (bound(?slash) && (?slash > ?hash))), ?slash, ?hash) AS ?sep) . BIND (fn:substring(?uri, (?sep + 2)) AS ?localName) . }
spif:localName(<http://example.org/test#Aldi>)
spif:localName(<http://example.org/test/.123>)
Converts an input string into lower camel case. For example, "semantic web" becomes "semanticWeb". An optional matching expression can be given to only convert the matched characters.
sp:arg1 (xsd:string): the input string
|
sp:arg2 (xsd:string): [Optional] The match expression
|
Converts an input string into lower case. For example, "SEMANTIC Web" becomes "semantic web". An optional matching expression can be given to only convert the matched characters.
sp:arg1 (xsd:string): the input string
|
sp:arg2 (xsd:string): [Optional] The match expression
|
Converts an input string into lower title case. For example, "semantic web" becomes "semantic Web". An optional matching expression can be given to only convert the matched characters.
sp:arg1 (xsd:string): the input string
|
sp:arg2 (xsd:string): [Optional] The match expression
|
The mathematical modulo operator, aka % in Java.
sp:arg1 (xsd:integer): The first operand.
|
sp:arg2 (xsd:integer): The second argument.
|
spif:mod(3, 2)
Gets a human-readable string representation from an RDF node. If it's a literal, the function will return the literal's lexical text. If it's a resource the system will use the rdfs:label (if exists) or otherwise use the qname. For an unbound input, the function will return no value.
sp:arg1: the node (literal or resource) that shall be rendered into a string
|
Converts a string in a semi-structured format into a xsd:date, xsd:dateTime or xsd:time literal. The input string must be in a given template format, e.g. "yyyy.MM.dd G 'at' HH:mm:ss z" for strings such as 2001.07.04 AD at 12:08:56 PDT.
sp:arg1 (xsd:string): the input text
|
arg:pattern (xsd:string): The template of the input string. This must conform to the pattern language implemented by the Java SimpleDateFormat class (http://docs.oracle.com/javase/7/docs/api/java/text/SimpleDateFormat.html).
|
arg:patternLanguage (xsd:string): [Optional] The code of the language (e.g. "de" for German) to use for parsing.
|
spif:parseDate("February 13, 2008", "MMMMMMMMM dd, yyyy")
spif:parseDate("February 13 2008", "MMMMMMMMM dd yyyy")
spif:parseDate("2/13/2008", "MM/dd/yyyy")
spif:parseDate("13.02.2008", "dd.MM.yyyy")
spif:parseDate("13 February, 2008", "dd MMMMMMMMM, yyyy")
spif:parseDate("13 February 2008", "dd MMMMMMMMM yyyy")
spif:parseDate("13/2/2008", "dd/MM/yyyy")
spif:parseDate("1830", "hhmm")
spif:parseDate("20080213", "yyyyMMdd")
spif:parseDate("200802131830", "yyyyMMddhhmm")
Can be used to get namespaces and their prefixes. This magic property takes the namespace (string) or a variable on the left and a prefix or a variable on the right. If both are unbound variables, then it will iterate over all namespaces and their prefixes. Otherwise it will bind the namespace or prefix. If both are bound, the system checks whether the given prefix is for the given namespace.
sp:arg1 (xsd:string): The namespace (string) or an unbound variable.
|
Creates a random xsd:double between 0 and 1.
For a given SPIN RDF expression or command (left hand side) this magic property delivers all used variables (right hand side). The algorithm basically walks into all depending blank nodes from the root and returns all unique values of sp:varName.
An input string is converted into a result string by applying a match and replacement expressions. For example, the input string "semantic web" with the match expression "([A-z]+) ([A-z]+)" and the replacement expression "The $1 life" returns the string "The semantic life". An optional input string is returned, if no match occurs. If this string is empty and no match occurs, then the result string is unbound.
sp:arg1 (xsd:string): the input string
|
sp:arg2 (xsd:string): The match expression
|
sp:arg3 (xsd:string): The replacement expression
|
sp:arg4 (xsd:string): [Optional] The optional string returned as result string if no match occurs. If this string is empty and no match occurs, then the result string is unbound.
|
Does a string replacement based on the Java function String.replaceAll().
sp:arg1 (xsd:string): The string to operate on.
|
sp:arg2 (xsd:string): The regular expression to search for.
|
sp:arg3 (xsd:string): The replacement string.
|
Finds the shortest path from a given subject walking up a given predicate (for example, rdfs:subClassOf) and returns the path as a string of URIs separated with a space. This can be used to find the shortest path from a resource in a tree structure to the root resource.
sp:arg1 (rdfs:Resource): The subject to start with.
|
sp:arg2 (rdf:Property): The predicate to walk, e.g. rdfs:subClassOf or skos:broader.
|
sp:arg3 (rdfs:Resource): [Optional] The optional target resource (root of the tree). If not specified, then the first node that has no further objects will be used.
|
Finds the shortest path from a given object walking up a given predicate (for example, schema:child) and returns the path as a string of URIs separated with a space. This can be used to find the shortest path from a resource in a tree structure to the root resource.
sp:arg1 (rdfs:Resource): The object to start with.
|
sp:arg2 (rdf:Property): The predicate to walk, e.g. schema:child.
|
sp:arg3 (rdfs:Resource): [Optional] The optional target resource (root of the tree). If not specified, then the first node that has no further subjects will be used.
|
Splits a given string and iterates over all sub-strings. An unbound variable must be placed on the left side of this magic property. A list with two members must be on the right. The first is the string to split, and the second is a regular expression. For example, ?str spif:split ("Hello World" " ") will bind ?str to "Hello" and "World".
Returns the time of a given xsd:dateTime value in milliseconds.
sp:arg1 (xsd:dateTime): The xsd:dateTime to convert.
|
Converts a given time milliseconds value (xsd:long or xsd:integer) into a corresponding xsd:dateTime literal.
arg:millis (xsd:long): The milliseconds to convert.
|
Converts an input string to title case. For example, "germany" becomes "Germany". An optional matching expression can be given to only convert the matched characters.
sp:arg1 (xsd:string): The input string
|
sp:arg2 (xsd:string): [Optional] The match expression
|
Produces a valid Java identifier based on a given input string, dropping any characters that would not be valid Java identifiers. Produces the empty string if no character can be reused from the given string. Note that this function is even stricter than the normal Java identifier algorithm, as it only allows ASCII characters or digits.
sp:arg1 (xsd:string): The input string.
|
Creates a new string value by trimming an input string. Leading and trailing whitespaces are deleted.
sp:arg1 (xsd:string): the text to trim
|
Converts an input string into a reverse camel case.
sp:arg1 (xsd:string): the input string
|
spif:unCamelCase("SemanticWeb")
spif:unCamelCase("semanTic_Web23")
Converts an input string into upper case. For example, "semantic web" becomes "SEMANTIC WEB". An optional matching expression can be given to only convert the matched characters.
sp:arg1 (xsd:string): The input string
|
sp:arg2 (xsd:string): [Optional] The match expression
|
Performs a depth-first tree traversal starting at a given node (?arg1) and then following the objects using a given predicate (?arg2). For each node it applies a given function (?arg3) that must take the current node as its first argument. All other arguments of the walkObjects function call will be passed into that function. The traversal stops on the first non-null result of the nested function calls. As use case of this function is to walk up superclasses, e.g. to find the "nearest" owl:Restriction of a certain kind.
sp:arg1 (rdfs:Resource): The start node of the traversal.
|
sp:arg2 (rdf:Property): The property to walk up.
|
sp:arg3 (spin:Function): The SPIN/SPARQL function to execute for each node.
|
Executes a given ASK query and returns its boolean result. The first argument must point to an sp:Ask or a SPIN template call that has an ASK query as its body. All subsequent argument can come in pairs, with the first one being a variable name and the second its binding. Example: BIND (spin:ask(?query, "this", owl:Thing) AS ?result) . will execute the sp:Ask behind ?query with the variable ?this pre-bound to owl:Thing.
Evaluates a given sp:Construct or SPIN template call (first argument on the left hand side) and binds the resulting triples to the variables on the right hand side. Example: (?query "this" owl:Thing) spin:construct (?s ?p ?o) will execute the sp:Construct ?query using the binding of owl:Thing to ?this. The resulting triples will be bound to ?s, ?p and ?o. If any of ?s ?p ?o are bound, it will only return the matching triples.
Takes an instance (?arg1) and a class definition (?arg2) and returns all constraint violations for that instance as triples. This magic property basically runs its own constraint checker for defining meta-constraints, and can also be used to classify instances. Example: CONSTRUCT { ?s ?p ?o . } WHERE { (my:Person my:OldPerson) spin:constructViolations (?s ?p ?o) . }
sp:arg1 (rdfs:Resource): The instance to check.
|
sp:arg2 (rdfs:Class): The class that this type is validated against.
|
Evaluates a given SPIN expression or SELECT or ASK query, and returns its result. The first argument must be the expression in SPIN RDF syntax. All other arguments must come in pairs: first a property name, and then a value. These name/value pairs will be pre-bound variables for the execution of the expression.
sp:arg1: The expression to evaluate. Should be a sp:Select, sp:Ask, a sp:Variable or an instance of a SPARQL function class, but may also be a simple RDF value.
|
Evaluates a given SPIN expression or SELECT or ASK query, and returns its result. The first argument must be the expression in SPIN RDF syntax. This RDF representation of this expression is expected to be in the currently active query graph. The second argument is the URI of a graph that the actual query shall be evaluated against. All other arguments must come in pairs: first a property name, and then a value. These name/value pairs will be pre-bound variables for the execution of the expression.
Executes a given SELECT or ASK query (or a corresponding SPIN template call) and binds its result rows to the variables specified on the right hand side. May also pre-bind variables for the query execution, using name-value pairs on the left hand side. Example: (?query "this" owl:Thing) spin:select (?a ?b) will execute the sp:Select or sp:Ask that ?query points to and pre-bind ?this with the value of owl:Thing for the execution of the query. The first result variable of the query's result set will be bound to ?a, the second to ?b etc. If the nodes on the right are bound (or constants) then it will match with the values from the result set. Note that the first argument on the left hand side can be an instance of a SPIN template (but not the template itself). If you need to execute a template, retrieve its spin:body first.
Checks whether a given instance (?arg1) violates any of the constraints defined for a given class (?arg2).
sp:arg1 (rdfs:Resource): The instance to check.
|
sp:arg2 (rdfs:Class): The class to get the constraints of.
|
Returns the input value unchanged. This is a placeholder to indicate that a direct link between two properties shall be created. Technically, it creates the value(s) for the target property using the value(s) of the source property as provided by the argument (?arg1).
sp:arg1: The value to copy.
|
SELECT ?arg1 WHERE { }
Gets the resource that is target of a mapping, based on a provided mapping context (?context) and a source resource (?arg1).
sp:arg1 (rdfs:Resource): The source resource that will be passed into the function.
|
spinmap:context (spinmap:Context): The Context that will deliver an instance of a function that delivers the target resource from a source resource (?sourceResource).
|
SELECT (spin:eval(?targetExpr, spinmap:source, ?arg1) AS ?result) WHERE { BIND (spl:object(?context, spinmap:target) AS ?targetExpr) . }
A variation of spif:buildURI that can be used in conjunction with SPINMap. This takes the template as second argument, making it possible to enter a template that uses {?1} from the values of the first parameter.
sp:arg1: The value to insert into the template at {?1}.
|
arg:template (xsd:string): The URI template, referencing the value to insert as {?1}.
|
SELECT ?result WHERE { BIND (spif:buildURI(?template, ?arg1) AS ?result) . }
Builds a new URI using the value of a given property (?arg1) from a given subject (?source) and a given template (?template). The template may reference the value of the property using {?1}.
sp:arg1 (rdf:Property): The property to get the value of.
|
spinmap:source (rdfs:Resource): The source resource.
|
spinmapl:template (xsd:string): The template string, "ex:Instance-{?1}".
|
SELECT (IRI(?uri) AS ?result) WHERE { BIND (spl:object(?source, ?arg1) AS ?value) . BIND (spif:buildURI(?template, ?value) AS ?uri) . }
Builds URIs of the target resources using values of two given properties (?arg1 and ?arg2) for the source resources and a given template (?template). The template may reference the values of the properties using {?1} and {?2} respectively.
sp:arg1 (rdf:Property): The first property to get the value of.
|
sp:arg2 (rdf:Property): The second property.
|
spinmap:source (rdfs:Resource): The source resource.
|
spinmapl:template (xsd:string): The template string, "ex:Instance-{?1}".
|
SELECT (IRI(?uri) AS ?result) WHERE { BIND (spl:object(?source, ?arg1) AS ?value1) . BIND (spl:object(?source, ?arg2) AS ?value2) . BIND (spif:buildURI(?template, ?value1, ?value2) AS ?uri) . }
Builds URIs of the target resources using values of three given properties (?arg1, ?arg2 and ?arg3) for the source resources and a given template (?template). The template may reference the values of the properties using {?1}, {?2} and {?3} respectively.
sp:arg1 (rdf:Property): The first property to get the value of.
|
sp:arg2 (rdf:Property): The second property.
|
sp:arg3 (rdf:Property): The third property.
|
spinmap:source (rdfs:Resource): The source resource.
|
spinmapl:template (xsd:string): The template string, "ex:Instance-{?1}".
|
SELECT (IRI(?uri) AS ?result) WHERE { BIND (spl:object(?source, ?arg1) AS ?value1) . BIND (spl:object(?source, ?arg2) AS ?value2) . BIND (spl:object(?source, ?arg3) AS ?value3) . BIND (spif:buildURI(?template, ?value1, ?value2, ?value3) AS ?uri) . }
Builds URIs of the target resources using values of four given properties (?arg1, ?arg2, ?arg3 and ?arg4) for the source resources and a given template (?template). The template may reference the values of the properties using {?1}, {?2}, {?3} and {?4} respectively.
sp:arg1 (rdf:Property): The first property to get the value of.
|
sp:arg2 (rdf:Property): The second property.
|
sp:arg3 (rdf:Property): The third property.
|
sp:arg4 (rdf:Property): The forth property.
|
spinmap:source (rdfs:Resource): The source resource.
|
spinmapl:template (xsd:string): The template string, "ex:Instance-{?1}".
|
SELECT (IRI(?uri) AS ?result) WHERE { BIND (spl:object(?source, ?arg1) AS ?value1) . BIND (spl:object(?source, ?arg2) AS ?value2) . BIND (spl:object(?source, ?arg3) AS ?value3) . BIND (spl:object(?source, ?arg4) AS ?value4) . BIND (spif:buildURI(?template, ?value1, ?value2, ?value3, ?value4) AS ?uri) . }
Builds URIs of the target resources using values of five given properties (?arg1, ?arg2, ?arg3, ?arg4 and ?arg5) for the source resources and a given template (?template). The template may reference the values of the properties using {?1}, {?2}, {?3}, {?4} and {?5} respectively.
sp:arg1 (rdf:Property): The first property to get the value of.
|
sp:arg2 (rdf:Property): The second property.
|
sp:arg3 (rdf:Property): The third property.
|
sp:arg4 (rdf:Property): The forth property.
|
sp:arg5 (rdf:Property): The firth property.
|
spinmap:source (rdfs:Resource): The source resource.
|
spinmapl:template (xsd:string): The template string, "ex:Instance-{?1}".
|
SELECT (IRI(?uri) AS ?result) WHERE { BIND (spl:object(?source, ?arg1) AS ?value1) . BIND (spl:object(?source, ?arg2) AS ?value2) . BIND (spl:object(?source, ?arg3) AS ?value3) . BIND (spl:object(?source, ?arg4) AS ?value4) . BIND (spl:object(?source, ?arg5) AS ?value5) . BIND (spif:buildURI(?template, ?value1, ?value2, ?value3, ?value4, ?value5) AS ?uri) . }
Replaces the namespace of the source URIs by a given target namespace to create URIs of the target resources.
spinmap:source (rdfs:Resource): The source resource.
|
spinmapl:targetNamespace (xsd:string): The target namespace.
|
SELECT ?target WHERE { BIND (afn:localname(?source) AS ?localName) . BIND (IRI(CONCAT(?targetNamespace, ?localName)) AS ?target) . }
spinmapl:changeNamespace(owl:Thing, "http://example.org/test#")
Builds URIs of the target resources using the local name of the source resources and a template given as ?template. The template may reference the value of the local name of a source resource using {?1}.
spinmap:source (rdfs:Resource): The source resource.
|
spinmapl:template (xsd:string): The template string, "ex:Instance-{?1}".
|
SELECT (IRI(?uri) AS ?result) WHERE { BIND (spif:localName(?source) AS ?value) . BIND (spif:buildURI(?template, ?value) AS ?uri) . }
Creates the value(s) for the target property by concatenating the value(s) of the source properties as provided by the arguments (?arg1) and (?arg2) with a given separator in between (?separator).
sp:arg1: The first value to concatenate.
|
sp:arg2: The second value to concatenate.
|
spinmapl:separator (xsd:string): The separator to put between the two values.
|
SELECT (xsd:string(?untyped) AS ?result) WHERE { BIND (CONCAT(xsd:string(?arg1), ?separator, xsd:string(?arg2)) AS ?untyped) . }
Gives the target property values that are equal to a constant resource provided as (?result) argument. This can be used to create a constant value for the target whenever a given (?arg1) property of the source has a value.
sp:arg1: The input value (will be ignored).
|
spinmapl:result (rdfs:Resource): The result resource.
|
SELECT ?result WHERE { }
Creates a value for the target property by removing a set number of characters given as ?segmentLength argument from the end of the values of the source property specified as (?arg1) argument. This can be used to derive a �parent� value from a �child� path expression, e.g., parent of �W01020� is �W010�. Useful when parsing hierarchies where hierarchical relationships are encoded in the identifiers or �hierarchical path strings�. Note that this function preserves the original datatype of the input value for the result.
sp:arg1 (xsd:string): The path expression, e.g. "W010203"
|
spinmapl:segmentLength (xsd:integer): The number of characters to remove from the end of the input string.
|
SELECT ?result WHERE { { BIND (STRLEN(str(?arg1)) AS ?length) . FILTER (?length > ?segmentLength) . } . BIND (datatype(?arg1) AS ?dt) . BIND (fn:substring(str(?arg1), 1, (?length - ?segmentLength)) AS ?substr) . BIND (IF(bound(?dt), spif:cast(?substr, ?dt), ?substr) AS ?result) . }
spinmapl:fixedLengthPathParent("W010203", 2)
Gets the parent of a path expression (using the function fixedLengthPathParent) and finds a source instance with a matching value for a given property. Then it finds the target resource for that source instance.
sp:arg1 (xsd:string): The path expression.
|
spinmapl:context (spinmap:Context): The context to use for deriving the target from the source instance.
|
spinmapl:predicate (rdf:Property): The predicate that holds the parent path value in the source instance.
|
spinmapl:segmentLength (xsd:integer): The number of characters to remove from the end of the path expression.
|
SELECT (spinmap:targetResource(?source, ?context) AS ?target) WHERE { BIND (spinmapl:fixedLengthPathParent(?arg1, ?segmentLength) AS ?parentName) . FILTER bound(?parentName) . BIND (spl:subject(?predicate, ?parentName) AS ?source) . FILTER bound(?source) . }
Takes a path expression such as "World > Europe > Germany" provided as values of ?arg1 and a ?separator such as �>� and returns the last element, e.g. "Germany" .
sp:arg1 (xsd:string): The path expression.
|
spinmapl:separator (xsd:string): The separator of path elements. Elements will be trimmed for white spaces, so the separator does not need to specify them.
|
SELECT (IF(bound(?last), spif:trim(smf:subString(?arg1, (?last + 1))), ?arg1) AS ?result) WHERE { BIND (spif:lastIndexOf(?arg1, ?separator) AS ?last) . }
Takes a path expression such as "World > Europe > Germany" provided as values of ?arg1 and a ?separator such as �>� and returns the last but one element, e.g. "Europe".
sp:arg1 (xsd:string): The path expression.
|
spinmapl:separator (xsd:string): The separator of path elements. Elements will be trimmed for white spaces, so the separator does not need to specify them.
|
SELECT ?parent WHERE { BIND (spif:lastIndexOf(?arg1, ?separator) AS ?last) . FILTER bound(?last) . BIND (spif:lastIndexOf(?arg1, ?separator, (?last - 1)) AS ?last1) . BIND (IF(bound(?last1), (?last1 + 1), 0) AS ?start) . BIND (spif:trim(smf:subString(?arg1, ?start, ?last)) AS ?parent) . }
spinmapl:pathParent("World > Europe > Germany", ">")
spinmapl:pathParent("Europe,Germany", ",")
spinmapl:pathParent("World", ">")
Gets the parent of a path expression (using the function pathParent) and finds a source instance with a matching value for a given property. Then it finds the target resource for that source instance. This is a highly specialized function for a design pattern often used in spreadsheets, where one column contains the full path expression, and the other contains the name of the item.
sp:arg1 (xsd:string): The path expression.
|
spinmapl:context (spinmap:Context): The context to use for deriving the target from the source instance.
|
spinmapl:predicate (rdf:Property): The predicate that holds the parent path value in the source instance.
|
spinmapl:separator (xsd:string): The path separator, e.g. ">".
|
SELECT ?target WHERE { BIND (spinmapl:pathParent(?arg1, ?separator) AS ?parentName) . FILTER bound(?parentName) . BIND (spl:subject(?predicate, ?parentName) AS ?source) . BIND (spinmap:targetResource(?source, ?context) AS ?target) . }
This function uses a property given as ?predicate argument to find resources related to the resources in the source class as objects in a triple {?source ?predicate ?object}. It then applies mapping for these �related objects� as specified in a context given as ?context argument to build the target resource. This is useful if the source instances we want to use for the target are one step away from the current source instances, but we want to give the targets some of the properties of the current source instances.
spinmapl:context (spinmap:Context): The Context to apply to the related source resource to create the target resource.
|
spinmapl:predicate (rdf:Property): The predicate that connects resources from the source class to related resources.
|
spinmap:source (rdfs:Resource): The source resource.
|
SELECT (spinmap:targetResource(?object, ?context) AS ?result) WHERE { ?source ?predicate ?object . }
This function uses a property given as ?predicate argument to find resources related to the resources in the source class as subjects in a triple {?subject ?predicate ?source}. It then applies mapping for these related subjects as specified in a context given as ?context argument to build target resources. This is useful if the source instances we want to use for the target are one step away from the current source instances, but we want to give the targets some of the properties of the current source instances.
spinmapl:context (spinmap:Context): The SPINMap Context to apply to the related source resource to create the target resource.
|
spinmapl:predicate (rdf:Property): The predicate that connects resources from the source class to related resources.
|
spinmap:source (rdfs:Resource): The source resource.
|
SELECT (spinmap:targetResource(?subject, ?context) AS ?result) WHERE { ?subject ?predicate ?source . }
Takes a value and builds a URI for an instance of a given class, using the primary key defined for that class.
sp:arg1: The value to build the primary key with.
|
arg:class (rdfs:Class): The class (that has a primary key).
|
SELECT ?resource WHERE { BIND (swa:primaryKeyURIStart(?class) AS ?uriStart) . BIND (IRI(CONCAT(?uriStart, ENCODE_FOR_URI(xsd:string(?arg1)))) AS ?resource) . }
Takes a value (?arg1) and a property (?predicate), as well as an optional type, and returns a resource that has the given value as object for the predicate. For example, this can be used to find an instance of the class Country that has "Australia" as its label.
sp:arg1: The value to match against.
|
spinmapl:predicate (rdf:Property): The property that must be used in the result resource.
|
spinmapl:type (rdfs:Class): [Optional] The (optional) type of the result object, to narrow down the search space.
|
SELECT ?subject WHERE { ?subject ?predicate ?arg1 . ?t (rdfs:subClassOf)* ?type . ?subject a ?t . }
A simple function that returns the source instance itself, reusing exactly the same URIs and blank node identifiers.
spinmap:source (rdfs:Resource): The source resource.
|
SELECT ?source WHERE { }
Can be used to construct "self-join" matches, where the result is a resource from the target ontology.
sp:arg1: The value(s) that the source instance must have for the predicate.
|
spinmapl:context (spinmap:Context): The context to create the result resource with.
|
spinmapl:predicate (rdf:Property): The predicate to look for.
|
SELECT (spinmap:targetResource(?source, ?context) AS ?target) WHERE { ?source ?predicate ?arg1 . ?context spinmap:sourceClass ?sourceClass . ?type (rdfs:subClassOf)* ?sourceClass . ?source a ?type . }
Takes true/false or yes/no values (ignoring case) and maps them to true/false as xsd:boolean literals.
sp:arg1 (xsd:string): The (string) value to convert. Should be "yes" or "no".
|
SELECT ?result WHERE { BIND (LCASE(str(?arg1)) AS ?str) . BIND (IF((?str IN ("yes", "true")), true, IF((?str IN ("no", "false")), false, ?none)) AS ?result) . }
Builds a URI based on a primary key definition. Assumes that the target class of the given SPINMap Context has an spl:PrimaryKeyPropertyConstraint - either directly or via class inheritance. There also must be a 1-1 mapping associated with that Context that produces values for primary key property. The function runs that mapping to produce the value of the primary key property for the given source instance and then uses that value to build a URI, using the uriStart of the primary key declaration.
spinmapl:context (spinmap:Context): The SPINMap Context to apply to the related source resource to create the target resource.
|
spinmap:source (rdfs:Resource): The source resource.
|
SELECT ?uri WHERE { { { ?context spinmap:targetClass ?targetClass . BIND (swa:primaryKeyProperty(?targetClass) AS ?targetProperty) . BIND (swa:primaryKeyURIStart(?targetClass) AS ?uriStart) . FILTER (bound(?uriStart) && bound(?targetProperty)) . } . ?mapping spinmap:targetPredicate1 ?targetProperty . ?mapping spinmap:context ?context . ?mapping a spinmap:Mapping-1-1 . ?mapping spinmap:sourcePredicate1 ?sourceProperty . ?mapping spinmap:expression ?expression . ?source ?sourceProperty ?sourceValue . BIND (spin:eval(?expression, sp:arg1, ?sourceValue) AS ?targetValue) . FILTER bound(?targetValue) . } . BIND (IRI(CONCAT(?uriStart, ENCODE_FOR_URI(xsd:string(?targetValue)))) AS ?uri) . }
Checks if a given module class (?module) has at least one declared spl:Argument.
spl:class (spin:Module): The module class to check.
|
ASK WHERE { ?class (rdfs:subClassOf)* ?superClass . ?superClass spin:constraint ?con . ?con a spl:Argument . }
Checks if a given class has a declared primary key, using spl:PrimaryKeyPropertyConstraint.
arg:class (rdfs:Class): The class to get the primary key of.
|
ASK WHERE { BIND (spl:primaryKeyProperty(?class) AS ?primaryKey) . FILTER bound(?primaryKey) . }
Checks whether a given resource (?arg1) has a given value (?arg3) for a given property (?arg2) or one of the sub-properties of it.
sp:arg1 (rdfs:Resource): the subject that is expected to have the value
|
sp:arg2 (rdf:Property): the property that is expected to hold the value
|
sp:arg3: the expected value
|
ASK WHERE { ?p (rdfs:subPropertyOf)* ?arg2 . ?arg1 ?p ?arg3 . }
Checks whether a given subject (?arg1) has at least one value of a given type (?arg3) for a given property (?arg2) or one of its sub-properties.
sp:arg1 (rdfs:Resource): the subject that is expected to have the value
|
sp:arg2 (rdf:Property): the expected property
|
sp:arg3 (rdfs:Class): the type to match against
|
ASK WHERE { ?p (rdfs:subPropertyOf)* ?arg2 . ?arg1 ?p ?value . FILTER spl:instanceOf(?value, ?arg3) . }
Checks whether a given resource (?arg1) has a given type (?arg2). In order to fulfill this condition, there must either be a triple ?arg1 rdf:type ?arg2, or ?instance rdf:type ?subClass where ?subClass is a subclass of ?arg2. If the first argument is a literal, then the second argument must be the matching XSD datatype.
sp:arg1 (rdfs:Resource): the instance being tested
|
sp:arg2 (rdfs:Class): the type that the instance must have
|
ASK WHERE { { { FILTER (isIRI(?arg1) || isBlank(?arg1)) . } . ?class (rdfs:subClassOf)* ?arg2 . ?arg1 a ?class . } UNION { { FILTER isLiteral(?arg1) . } . BIND (datatype(?arg1) AS ?datatype) . FILTER (((?datatype = ?arg2) || (?arg2 = rdfs:Literal)) || (((!bound(?datatype)) || (rdf:langString = ?datatype)) && (?arg2 = xsd:string))) . } . }
spl:instanceOf("test"@en, xsd:string)
spl:instanceOf(owl:Thing, rdfs:Class)
spl:instanceOf(owl:versionInfo, rdfs:Class)
spl:instanceOf(owl:Restriction, rdfs:Class)
spl:instanceOf("test", rdfs:Literal)
spl:instanceOf(owl:Thing, rdfs:Literal)
spl:instanceOf("test", xsd:string)
spl:instanceOf("test", xsd:integer)
spl:instanceOf("test", xsd:string)
Checks if a given property is the primary key of a given instance.
arg:instance (rdfs:Resource): The instance to check.
|
arg:property (rdf:Property): The property that may or may not be the primary key.
|
ASK WHERE { ?instance a ?type . BIND (spl:primaryKeyProperty(?type) AS ?pk) . FILTER (?property = ?pk) . }
Checks whether a given literal is untyped. This function was introduced because the built-in datatype operand in SPARQL casts untyped literals to xsd:string, making it impossible to check it this way. This function here uses a work-around using sameTerm instead.
sp:arg1 (rdfs:Literal): The literal to test.
|
ASK WHERE { FILTER (isLiteral(?arg1) && (!sameTerm(?arg1, xsd:string(?arg1)))) . }
Takes two arguments and returns the larger one of them.
sp:arg1 (rdfs:Literal): The first argument.
|
sp:arg2 (rdfs:Literal): The second argument.
|
SELECT ?result WHERE { BIND (IF((?arg1 > ?arg2), ?arg1, ?arg2) AS ?result) . }
Takes two arguments and returns the smaller one of them.
sp:arg1 (rdfs:Literal): The first argument.
|
sp:arg2 (rdfs:Literal): The second argument.
|
SELECT ?result WHERE { BIND (IF((?arg1 < ?arg2), ?arg1, ?arg2) AS ?result) . }
Gets the object of a given subject (?arg1) / predicate (?arg2) combination. Note that if multiple values are present then the result might be unpredictably random. Furthermore, if one of the arguments is unbound, it will return the first match of the resulting SPO pattern. These scenarios are strongly discouraged but remain left supported for backward compatibility reasons.
sp:arg1 (rdfs:Resource): The subject to get the object from.
|
sp:arg2 (rdf:Property): The predicate to get the object of.
|
SELECT ?object WHERE { ?arg1 ?arg2 ?object . }
SELECT ?value WHERE { GRAPH <http://spinrdf.org/spl> { BIND (spl:object(spl:Argument, rdfs:label) AS ?value) . } . }
spl:object(owl:versionInfo, owl:versionInfo)
Gets the number of values of a given property (?arg2) at a given subject (?arg1). The result is the number of matches of (?arg1, ?arg2, ?object).
sp:arg1 (rdfs:Resource): the subject to get the number of objects of
|
sp:arg2 (rdf:Property): the property to get the number of values of
|
SELECT (COUNT(?object) AS ?result) WHERE { ?arg1 ?arg2 ?object . }
Gets the object of a given subject (?arg1) / predicate (?arg2) combination in a given graph ?arg3. Note that if multiple values are present then the result might be unpredictably random.
sp:arg1 (rdfs:Resource): The subject to get the object from.
|
sp:arg2 (rdf:Property): The predicate to get the object of.
|
sp:arg3 (rdfs:Resource): The graph to query in.
|
SELECT ?object WHERE { GRAPH ?arg3 { ?arg1 ?arg2 ?object . } . }
Gets the object of a given subject (?arg1) / predicate (?arg2) combination, also taking the sub-properties of ?arg2 into account. Note that if multiple values are present then the result might be unpredictably random.
sp:arg1 (rdfs:Resource): The subject to get the object from.
|
sp:arg2 (rdf:Property): The predicate to get the object of (including sub-properties of it).
|
SELECT ?object WHERE { ?property (rdfs:subPropertyOf)* ?arg2 . ?arg1 ?property ?object . }
Gets the primary key property declared for a given class, using spl:PrimaryKeyPropertyConstraint.
arg:class (rdfs:Class): The class to get the primary key of.
|
SELECT ?property WHERE { ?class (rdfs:subClassOf)* ?type . ?type spin:constraint ?constraint . ?constraint a spl:PrimaryKeyPropertyConstraint . ?constraint arg:property ?property . }
Gets the URI start declared as part of a primary key declaration for a given class, using spl:PrimaryKeyPropertyConstraint.
arg:class (rdfs:Class): The class to get the primary key of.
|
SELECT ?result WHERE { ?class (rdfs:subClassOf)* ?type . ?type spin:constraint ?constraint . ?constraint a spl:PrimaryKeyPropertyConstraint . ?constraint arg:uriStart ?result . }
A magic property that establishes a relationship between properties (left) and classes (right) to determine which properties are "relevant" for the class. Relevant means that they have the class in their domain and/or restrictions, including superclasses and sub-properties (unless they define their own domain). Domains consisting of an owl:unionOf are also handled. Note that the performance of the body of this magic property has been optimized for the case in which the class is given, so ideally use this for queries such as ?property spl:relevantPropertyAtClass skos:Concept .
sp:arg1 (rdf:Property): The property.
|
SELECT DISTINCT ?class WHERE { ?class (rdfs:subClassOf)* ?superClass . { ?property rdfs:domain ?superClass . } UNION { ?superClass owl:onProperty ?property . } UNION { ?listSegment rdf:first ?superClass . ?list (rdf:rest)* ?listSegment . ?property rdfs:domain/owl:unionOf ?list . } . ?arg1 (rdfs:subPropertyOf)* ?property . FILTER ((?arg1 = ?property) || NOT EXISTS { ?arg1 rdfs:domain ?anyDomain . }) . FILTER isIRI(?class) . }
Checks whether a given class (?arg1) is a (transitive) sub-class of another class (?arg2).
sp:arg1 (rdfs:Class): The potential sub-class.
|
sp:arg2 (rdfs:Class): The potential super-class.
|
ASK WHERE { ?arg1 (rdfs:subClassOf)* ?arg2 . }
Checks whether a given property (?arg1) is a (transitive) sub-property of another property (?arg2).
sp:arg1 (rdf:Property): The potential sub-property.
|
sp:arg2 (rdf:Property): The potential super-property.
|
ASK WHERE { ?arg1 (rdfs:subPropertyOf)* ?arg2 . }
Gets the "first" subject of a given predicate (?arg1)/object (?arg2) combination. Note that if multiple values are present then the result might be unpredictably random.
sp:arg1 (rdf:Property): The predicate.
|
sp:arg2: The object.
|
SELECT ?subject WHERE { ?subject ?arg1 ?arg2 . }
Gets the number of values of a given property (?arg1) at a given object (?arg2). The result is the number of matches of (?subject, ?arg1, ?arg2).
sp:arg1 (rdf:Property): the predicate to get the number of subjects of
|
sp:arg2: the object to get the number of subjects of
|
SELECT (COUNT(?subject) AS ?result) WHERE { ?subject ?arg1 ?arg2 . }
Gets the "first" subject of a given predicate (?arg1)/object (?arg2) combination in a given graph (?arg3). Note that if multiple values are present then the result might be unpredictably random.
sp:arg1 (rdf:Property): The predicate.
|
sp:arg2: The object.
|
sp:arg3 (rdfs:Resource): The graph to operate on.
|
SELECT ?subject WHERE { GRAPH ?arg3 { ?subject ?arg1 ?arg2 . } . }
Applies the spr:Aggregator ?arg1 to all rows of column ?arg3 of spr:Table ?arg2.
sp:arg1 (spr:Aggregator): The aggregator to perform.
|
sp:arg2 (spr:Table): The spr:Table to iterate over.
|
sp:arg3 (xsd:integer): The column index.
|
SELECT ?result WHERE { ?arg1 spr:stepFunction ?stepFunction . ?arg1 spr:startValue ?startValue . OPTIONAL { ?arg1 spr:resultFunction ?resultFunction . } . BIND (spr:rowCount(?arg2) AS ?rowCount) . BIND (spr:visitCol(?arg2, ?arg3, 0, (?rowCount - 1), ?stepFunction, ?startValue) AS ?stepped) . BIND (IF(bound(?resultFunction), spif:invoke(?resultFunction, ?stepped, ?rowCount), ?stepped) AS ?result) . }
Applies the spr:Aggregator ?arg1 to all columns of row ?arg3 of spr:Table ?arg2.
sp:arg1 (spr:Aggregator): The aggregator to perform.
|
sp:arg2 (spr:Table): The spr:Table to iterate over.
|
sp:arg3 (xsd:integer): The row index.
|
SELECT ?result WHERE { ?arg1 spr:stepFunction ?stepFunction . ?arg1 spr:startValue ?startValue . OPTIONAL { ?arg1 spr:resultFunction ?resultFunction . } . BIND (spr:colCount(?arg2) AS ?colCount) . BIND (spr:visitRow(?arg2, ?arg3, 0, (?colCount - 1), ?stepFunction, ?startValue) AS ?stepped) . BIND (IF(bound(?resultFunction), spif:invoke(?resultFunction, ?stepped, ?colCount), ?stepped) AS ?result) . }
Gets the cell value of a given Table (?arg1) at a given row (?arg2) and column (?arg3).
sp:arg1 (spr:Table): The spr:Table to get the cell value of.
|
sp:arg2 (xsd:integer): The row index, starting at 0.
|
sp:arg3 (xsd:integer): The column index, starting at 0.
|
SELECT ?result WHERE { ?arg1 a ?tableClass . ?tableClass spr:cellFunction ?function . BIND (spif:invoke(?function, ?arg1, ?arg2, ?arg3) AS ?result) . }
Iterates over all rows of a given table (left side, ?arg1) at column ?arg2 and binds the variable on the right with the cell values. The second variable on the right may be bound to the row index as well.
sp:arg1 (spr:Table): The spr:Table to get the values for.
|
sp:arg2 (xsd:integer): The column index, starting at zero.
|
SELECT ?value ?row WHERE { ?arg1 spr:rowIndices ?row . BIND (spr:cell(?arg1, ?row, ?arg2) AS ?value) . }
Gets the number of columns of a given result set.
sp:arg1 (spr:TableClass): The table to get the number of columns of.
|
SELECT ?result WHERE { ?arg1 a ?tableClass . ?tableClass spr:colCountFunction ?function . BIND (spif:invoke(?function, ?arg1) AS ?result) . }
Iterates over all columns of a given table (left side, ?arg1) and binds the variable on the right with the index of the columns.
sp:arg1 (spr:Table): The spr:Table to get the row indexes of.
|
SELECT ?index WHERE { BIND ((spr:colCount(?arg1) - 1) AS ?lastIndex) . ?index tops:for ( 0 ?lastIndex ) . }
Gets the name of a column in a given result set. The name is usually derived from the variable name, but may also originate from spin:Columns attached to the table data provider.
sp:arg1 (spr:Table): The table to get the column name for.
|
sp:arg2 (xsd:integer): The column index, starting at zero.
|
SELECT ?result WHERE { ?arg1 a ?tableClass . ?tableClass spr:colNameFunction ?function . BIND (spif:invoke(?function, ?arg1, ?arg2) AS ?result) . }
Gets the (data) type of a column, if this information is present. The datatype may be derived from spin:Columns attached to the table data provider.
sp:arg1 (spr:Table): The table to get the column name for.
|
sp:arg2 (xsd:integer): The column index, starting at zero.
|
SELECT ?result WHERE { ?arg1 a ?tableClass . ?tableClass spr:colTypeFunction ?function . BIND (spif:invoke(?function, ?arg1, ?arg2) AS ?result) . }
Gets the width (in pixels) of a given column. This may have been derived from spin:Columns attached to the table data provider.
sp:arg1 (spr:Table): The table to get the column name for.
|
sp:arg2 (xsd:integer): The column index, starting at zero.
|
SELECT ?result WHERE { ?arg1 a ?tableClass . ?tableClass spr:colWidthFunction ?function . BIND (spif:invoke(?function, ?arg1, ?arg2) AS ?result) . }
Gets the index of a column with a given name.
sp:arg1 (spr:Table): The spr:Table to iterate over.
|
sp:arg2 (xsd:string): The name of the col to get.
|
SELECT ?colIndex WHERE { { ?arg1 spr:colIndices ?colIndex . BIND (spr:colName(?arg1, ?colIndex) AS ?colName) . } . FILTER (?colName = ?arg2) . }
Checks if there is a cell value in a given Table (?arg1) at a given row (?arg2) and column (?arg3).
sp:arg1 (spr:Table): The spr:Table to get the cell value of.
|
sp:arg2 (xsd:integer): The row index, starting at 0.
|
sp:arg3 (xsd:integer): The column index, starting at 0.
|
ASK WHERE { ?arg1 a ?tableClass . ?tableClass spr:cellFunction ?function . BIND (spif:invoke(?function, ?arg1, ?arg2, ?arg3) AS ?result) . FILTER bound(?result) . }
Checks whether a given SPR table has zero rows.
sp:arg1 (spr:Table): The spr:Table to get the number of rows for.
|
ASK WHERE { FILTER (spr:rowCount(?arg1) = 0) . }
Iterates over all columns of a given table (left side, ?arg1) at row ?arg2 and binds the variable on the right with the cell values. The second variable on the right may be bound to the column index as well.
sp:arg1 (spr:Table): The spr:Table to get the values for.
|
sp:arg2 (xsd:integer): The row index, starting at zero.
|
SELECT ?value ?col WHERE { ?arg1 spr:colIndices ?col . BIND (spr:cell(?arg1, ?arg2, ?col) AS ?value) . }
Gets the number of rows in a given table.
sp:arg1 (spr:Table): The spr:Table to get the number of rows for.
|
SELECT ?result WHERE { ?arg1 a ?tableClass . ?tableClass spr:rowCountFunction ?function . BIND (spif:invoke(?function, ?arg1) AS ?result) . }
Iterates over all rows of a given table (left side, ?arg1) and binds the variable on the right with the index of the rows.
sp:arg1 (spr:Table): The spr:Table to get the row indexes of.
|
SELECT ?index WHERE { BIND ((spr:rowCount(?arg1) - 1) AS ?lastIndex) . ?index tops:for ( 0 ?lastIndex ) . }
Visits a given column ?arg2 of Table ?arg1 with a given spr:AggregatorStepFunction (?arg5) and then calls itself recursively until the last value index (?arg4) has been reached. ?arg6 is the result of the previous step.
sp:arg1 (spr:Table): The spr:Table to iterate over.
|
sp:arg2 (xsd:integer): The row to iterate over.
|
sp:arg3 (xsd:integer): The current step index.
|
sp:arg4 (xsd:integer): The max number of steps to make.
|
sp:arg5 (spin:Function): The step function.
|
sp:arg6: The current aggregate value.
|
SELECT ?result WHERE { BIND (spr:cell(?arg1, ?arg3, ?arg2) AS ?value) . BIND (IF(bound(?value), spif:invoke(?arg5, ?arg6, ?value), ?arg6) AS ?next) . BIND (IF((?arg3 < ?arg4), spr:visitCol(?arg1, ?arg2, (?arg3 + 1), ?arg4, ?arg5, ?next), ?next) AS ?result) . }
Visits a given row ?arg2 of Table ?arg1 with a given spr:AggregatorStepFunction (?arg5) and then calls itself recursively until the last value index (?arg4) has been reached. ?arg6 is the result of the previous step.
sp:arg1 (spr:Table): The spr:Table to iterate over.
|
sp:arg2 (xsd:integer): The row to iterate over.
|
sp:arg3 (xsd:integer): The current step index.
|
sp:arg4 (xsd:integer): The max number of steps to make.
|
sp:arg5 (spin:Function): The step function.
|
sp:arg6: The current aggregate value.
|
SELECT ?result WHERE { BIND (spr:cell(?arg1, ?arg2, ?arg3) AS ?value) . BIND (IF(bound(?value), spif:invoke(?arg5, ?arg6, ?value), ?arg6) AS ?next) . BIND (IF(((?arg3 + 1) < ?arg4), spr:visitRow(?arg1, ?arg2, (?arg3 + 1), ?arg4, ?arg5, ?next), ?next) AS ?result) . }
Gets the current SWA application name. This can be set in as context variable "swaAppName".
SELECT (ui:contextValue("swaAppName") AS ?result) WHERE { }
arg:resource (rdfs:Resource): The resource to categorize.
|
SELECT ?label WHERE { BIND (afn:namespace(?resource) AS ?ns) . BIND (IRI(IF(STRENDS(?ns, "#"), SUBSTR(?ns, 1, (STRLEN(?ns) - 1)), ?ns)) AS ?graphURI) . BIND (COALESCE(swa:graphLabel(IRI(?ns)), swa:graphLabel(?graphURI), CONCAT("<", ?ns, ">")) AS ?label) . }
Gets a column label based on a given spin:TableDataProvider. Tries to find the rdfs:label of a spin:Column with the provided index.
arg:dataProvider (spin:TableDataProvider): [Optional] The data provider - may be null in which case the function returns unbound too.
|
arg:index (xsd:integer):
|
SELECT ?label WHERE { { FILTER bound(?dataProvider) . } . GRAPH ui:unionGraph { ?dataProvider spin:column ?column . ?column spin:columnIndex ?index . ?column rdfs:label ?label . } . }
Gets the global UI config graph - <http://server.topbraidlive.org/dynamic/uiconfig>
SELECT ?result WHERE { BIND (<http://server.topbraidlive.org/dynamic/uiconfig> AS ?result) . }
For a given shape, gets all declared constraints, identified by their constraint component and (if applicable) their parameter value. Example usage: ?shape swa:constraint ( ?component ?value ) .
sp:arg1 (rdfs:Resource): The shape to get the constraints of.
|
SELECT ?component ?value WHERE { { { ?arg1 swa:constraintComponent ?component . BIND (swa:singleParameter(?component) AS ?predicate) . FILTER bound(?predicate) . } . ?arg1 ?predicate ?value . } UNION { ?arg1 swa:constraintComponent ?component . BIND (swa:singleParameter(?component) AS ?predicate) . FILTER (!bound(?predicate)) . } . }
For a given shape, gets the constraint components of all declared constraints. Example usage: ?shape swa:constraintComponent ?component .
sp:arg1 (rdfs:Resource): The shape to get the constraints of.
|
SELECT DISTINCT ?component WHERE { ?arg1 ?predicate ?value . ?parameter sh:path ?predicate . ?component sh:parameter ?parameter . FILTER spl:instanceOf(?component, sh:ConstraintComponent) . }
Gets a display label for a constraint at a shape, using any declared sh:labelTemplate where possible.
arg:component (sh:ConstraintComponent): The sh:ConstraintComponent.
|
arg:parameter: [Optional] The (single) parameter value in cases such as sh:class, where multiple values may be present.
|
arg:shape (sh:Shape): The shape defining the constraint.
|
Counts how many times the substring appears in the larger string.
arg:string (xsd:string): The string to search in.
|
arg:subString (xsd:string): The sub-string that is expected to be part of the other string.
|
Takes the lang of a given literal and picks a suitable country code for it. If it's a two-letter code then it tries to find the default one associated with the language using swa:defaultCountryCodeForLanguageCode. For 5-letter codes such as en-UK it simply returns the second part lower-cased.
arg:lang (xsd:string): The lang code, either with 2 or 5 letters.
|
SELECT ?code WHERE { BIND (IF((fn:string-length(?lang) = 2), swa:defaultCountryCodeForLanguageCode(?lang), spif:lowerCase(fn:substring(?lang, 4))) AS ?code) . }
Produces a "suggested" URI for a property shape at a given shape for a given predicate. Results will be of the form [SHAPE-URI]-[PREDICATE-LOCAL-NAME][-"inverse], possibly with "-0", "-1" etc appended to make them unique.
arg:inverse (xsd:boolean): True to create an inverse.
|
arg:predicate (rdf:Property): The predicate to create a constraint for.
|
arg:shape (sh:Shape): The shape to add the constraint to (must be a URI).
|
arg:zindex (xsd:integer): [Optional] An optional index that will be used in recursive calls.
|
SELECT ?result WHERE { BIND (CONCAT(str(?shape), "-", afn:localname(?predicate), IF(?inverse, "-inverse", "")) AS ?base) . BIND (IRI(IF(bound(?zindex), CONCAT(?base, "-", str(?zindex)), ?base)) AS ?iri) . BIND (IF(EXISTS { ?iri ?anyP ?anyO . }, swa:createPropertyShapeURI(?inverse, ?predicate, ?shape, COALESCE((?zindex + 1), 0)), ?iri) AS ?result) . }
Gets the current data graph. By default this is simply the current query graph. Can be set to some other value using the context variable "dataGraph". This is used by the SWA form mechanism: a form may switch to a different query graph to collect schema information (properties, ranges etc), but some widgets need to return to the domain/instances model in call-backs (such as auto-complete).
SELECT (COALESCE(ui:contextValue("dataGraph"), ui:currentQueryGraph()) AS ?result) WHERE { }
Gets the "default" owl:Ontology in the current query graph. This is simply returning the first that it finds, so the context should make sure that only one exists or - at least - that the graph is a MultiUnion where the most relevant match is in the base graph that will be queried first. If no owl:Ontology is found, it uses ui:currentQueryGraph() and if that's not bound either then it's making up a URI.
SELECT (COALESCE(?ontology, ui:currentQueryGraph(), <urn:x-error:no-ontology-found>) AS ?result) WHERE { OPTIONAL { ?ontology a owl:Ontology . } . }
Gets the default property shape URI for a given shape/property combination. This is the URI of the shape + "-" + the local name of the property.
arg:property (rdf:Property): The path property.
|
arg:shape (sh:NodeShape): The shape or class to create the property shape for.
|
SELECT ?result WHERE { BIND (IRI(CONCAT(str(?shape), "-", afn:localname(?property))) AS ?result) . }
For a given parent resource (left hand side) this magic property delivers all "depending" objects declared via dash:composite. The right hand side of this magic property must be an unbound variable. Works only for sh:path expressions that are either IRIs or consist of a single inverse path with a named predicate, not arbitrary sh:paths.
sp:arg1 (rdfs:Resource): The parent resource.
|
SELECT DISTINCT ?child WHERE { ?arg1 swa:shapesForNode ?shape . ?shape sh:property ?propertyShape . ?propertyShape dash:composite true . ?propertyShape sh:path ?path . { FILTER isIRI(?path) . ?arg1 ?path ?child . } UNION { { ?path sh:inversePath ?inverse . FILTER isIRI(?inverse) . } . ?child ?inverse ?arg1 . } . }
Gets a ui:instanceView of a class that has been marked to match id "form". This function needs to be called from within the ui:graph.
arg:class (rdfs:Class): The class that the form is attached to.
|
SELECT ?form WHERE { ?class ui:instanceView ?form . ?form ui:id ?ids . ?id spif:split ( ?ids " " ) . FILTER (?id = "form") . }
Gets a ui:instanceView of a class that has been marked to match id "form" in the ui:configGraph().
arg:class (rdfs:Class): The class that the form is attached to.
|
SELECT ?form WHERE { { BIND (swa:configGraph() AS ?config) . } . GRAPH ?config { BIND (swa:directForm(?class) AS ?form) . } . }
Finds the properties that are directly attached to a given class. Note that this magic property should only be used if the class (left hand side) is given and the property (right hand side) is a variable. For the inverse operation, use swa:directRelevantPropertyOfClass.
sp:arg1 (rdfs:Class): The class to get the properties of.
|
SELECT DISTINCT ?property WHERE { { ?property rdfs:domain ?arg1 . } UNION { ?arg1 rdfs:subClassOf ?restriction . ?restriction owl:onProperty ?property . } UNION { { ?arg1 swa:directShapesForType ?shape . ?shape sh:property|sh:parameter ?propertyShape . FILTER (!dash:isDeactivated(?propertyShape)) . } . ?propertyShape sh:path ?property . FILTER isIRI(?property) . } . FILTER isIRI(?arg1) . }
Finds the classes that are directly attached to a given property. In SWA this is used by the class/property tree. Note that this magic property should only be used if the property (left hand side) is given. For the inverse operation, use swa:directRelevantClassOfProperty.
sp:arg1 (rdf:Property): The property to get the classes of.
|
SELECT DISTINCT ?class WHERE { { ?arg1 rdfs:domain ?class . } UNION { ?restriction owl:onProperty ?arg1 . ?class rdfs:subClassOf ?restriction . } UNION { { ?propertyShape sh:path ?arg1 . ?shape sh:property|sh:parameter ?propertyShape . FILTER (!dash:isDeactivated(?propertyShape)) . } . ?class swa:directShapesForType ?shape . } . FILTER isIRI(?class) . }
Gets all sh:Shapes associated with a given type. This is not walking up the class hierarchy but collects all classes that are also instances of sh:Shape, and any shapes declared using sh:targetClass. This magic property can be used in both directions, i.e. if either the class or the shape are given.
sp:arg1 (rdfs:Class): The type to get the property groups for.
|
SELECT DISTINCT ?shape WHERE { { ?shape sh:targetClass ?arg1 . } UNION { FILTER (bound(?arg1) && spl:instanceOf(?arg1, sh:Shape)) . BIND (?arg1 AS ?shape) . } UNION { FILTER ((bound(?shape) && spl:instanceOf(?shape, rdfs:Class)) && spl:instanceOf(?shape, sh:Shape)) . BIND (?shape AS ?arg1) . } . }
Checks whether the provided argument is unbound or false.
arg:value (xsd:boolean): [Optional] The input value.
|
ASK WHERE { FILTER ((!bound(?value)) || (!?value)) . }
sp:arg1 (rdfs:Class): The resource type.
|
SELECT ?property ?editable WHERE { { SELECT ?property (MIN(?editableL) AS ?editable) WHERE { { { { ?arg1 (rdfs:subClassOf)* ?type . ?superProperty rdfs:domain ?type . ?property (rdfs:subPropertyOf)* ?superProperty . FILTER swa:filterSystemResources(?property) . FILTER ((?property = ?superProperty) || NOT EXISTS { ?property rdfs:domain ?ownDomain . }) . } . BIND (swa:localRangeAtClass(?type, ?property) AS ?range) . } . FILTER EXISTS { ?range (rdfs:subClassOf)* owl:Thing . } . BIND (((?range = ?type) && (!spl:instanceOf(?property, spin:MagicProperty))) AS ?editableL) . } UNION { { { ?arg1 (rdfs:subClassOf)* ?type . ?type sh:property/sh:path ?property . FILTER isIRI(?property) . FILTER swa:filterSystemResources(?property) . } . BIND (swa:localRangeAtClass(?type, ?property) AS ?range) . } . FILTER EXISTS { ?range (rdfs:subClassOf)* owl:Thing . } . BIND (((?range = ?type) && (!spl:instanceOf(?property, spin:MagicProperty))) AS ?editableL) . } . } GROUP BY ?property } . }
Finds nearest parent class for given property
sp:arg1 (rdfs:Resource): Current subclass
|
sp:arg2 (rdf:Property):
|
SELECT ?value WHERE { ?arg1 (rdfs:subClassOf)* ?parentClass . ?parentClass ?arg2 ?value . } LIMIT 1
Picks a default namespace for new resources. This uses swa:defaultOntology to get hold of the default ontology. If this has a swa:defaultNamespace, then this will be used. Otherwise, the base URI + '/' of the default ontology is used.
SELECT ?result WHERE { BIND (swa:defaultOntology() AS ?ontology) . BIND (spl:object(?ontology, swa:defaultNamespace) AS ?default) . BIND (COALESCE(?default, CONCAT(xsd:string(?ontology), "/")) AS ?result) . }
Gets the "description" for a given resource. This will try to find a suitable value for one of the sub-properties of swa:description, based on the languages requested by the user. The function is natively implemented due to the complications of comparing languages and performance. The result might be any literal including rdf:HTML where applicable.
arg:resource (rdfs:Resource): The resource to get the image for.
|
Gets the global range (rdfs:range) of a property. If none is provided, it will walk up super-properties.
arg:property (rdf:Property): The property to get the range of.
|
SELECT ?range WHERE { ?property (rdfs:subPropertyOf)* ?p . ?p rdfs:range ?range . }
Checks whether a given graph is empty.
arg:graph (rdfs:Resource): The graph to test.
|
ASK WHERE { FILTER NOT EXISTS { GRAPH ?graph { ?s ?p ?o . } . } . }
Gets the display label of a given graph, with special handling of certain system namespaces.
arg:graph (rdfs:Resource): The graph to get the label for.
|
SELECT ?result WHERE { { ?graph rdfs:label ?result . } UNION { GRAPH ui:graph { ?graph rdfs:label ?result . } . } . }
Gets the URL of the GraphQL service for a given graph. Returns nothing for graphs that do not provide a GraphQL service.
arg:graph (rdfs:Resource): The URI of the graph to get the GraphQL service for.
|
Checks if a given string contains a given app name.
sp:arg1 (xsd:string): The string to check - may contain a comma-separated list of app names.
|
sp:arg2 (xsd:string): The name to match against, e.g. "EVN".
|
ASK WHERE { { FILTER (bound(?arg1) && bound(?arg2)) . } . ?sub1 spif:split ( ?arg1 "," ) . ?sub2 spif:split ( ?arg2 "," ) . FILTER (?sub1 = ?sub2) . }
Checks if the current context is in a given application, as identified by the context variable "swaAppName".
arg:appName (xsd:string): The name to match against, e.g. "EVN".
|
ASK WHERE { FILTER swa:hasAppName(ui:contextValue("swaAppName"), ?appName) . }
Checks whether there is a direct form attached to a given class.
arg:class (rdfs:Class): The class to check for a form.
|
ASK WHERE { GRAPH ui:graph { BIND (swa:directForm(?class) AS ?form) . FILTER bound(?form) . } . }
Checks whether a given class has a direct form attached to it, outside of the swa:configGraph(). Only classes that return false here can be edited by end users.
arg:class (rdfs:Class): The class to check.
|
ASK WHERE { GRAPH ui:graph { { { ?class ui:instanceView ?form . BIND (swa:directFormInConfigGraph(?class) AS ?configForm) . } . FILTER ((!bound(?configForm)) || (?form != ?configForm)) . } . ?form ui:id ?ids . ?id spif:split ( ?ids " " ) . FILTER (?id = "form") . } . }
Checks if the current query model defines a prefix for a given URI resource.
arg:resource (rdfs:Resource): The resource to check for a prefix.
|
ASK WHERE { BIND (afn:namespace(?resource) AS ?namespace) . ?namespace spif:prefix ?prefix . FILTER bound(?prefix) . }
arg:class (rdfs:Class): The class to check for the primary key.
|
ASK WHERE { BIND (swa:primaryKeyProperty(?class) AS ?property) . FILTER bound(?property) . }
Checks if a given focus node has a value for any property (or inverse properties) enumerated by a given sh:PropertyGroup.
arg:focusNode (rdfs:Resource): The node to test.
|
arg:group (sh:PropertyGroup): The property group.
|
ASK WHERE { ?focusNode swa:shapesForNodeFiltered ?shape . ?shape sh:property|sh:parameter ?propertyShape . ?propertyShape sh:group ?group . ?propertyShape sh:path ?path . FILTER ((isIRI(?path) && EXISTS { ?focusNode ?path ?any . }) || (isBlank(?path) && EXISTS { ?path sh:inversePath ?inverse . ?any ?inverse ?focusNode . })) . }
Gets the "first" value of a given property (such as sh:name) from inverse property constraints from all shapes associated with a given shape or class.
arg:predicate (rdf:Property): The constrained inverse property (value of sh:path/sh:inversePath).
|
arg:property (rdf:Property): The property to get, e.g. sh:order.
|
arg:resourceType (rdfs:Class): The class.
|
SELECT ?value WHERE { ?resourceType swa:shapesForType ?shape . ?shape sh:property|sh:parameter ?propertyShape . ?propertyShape sh:path ?path . ?path sh:inversePath ?predicate . ?propertyShape ?property ?value . FILTER isBlank(?path) . FILTER NOT EXISTS { ?propertyShape sh:deactivated true . } . }
Gets the "first" value of a given property (such as sh:name) from all property shapes on an inverse predicate associated with a given focus node. If the focus node is unbound (e.g. in search forms), this falls back to the swa:resourceTypes.
arg:predicate (rdf:Property): The constrained inverse property (value of sh:path/sh:inversePath).
|
arg:property (rdf:Property): The property to get, e.g. sh:order.
|
arg:resource (rdfs:Resource): [Optional] The focus node or unbound.
|
SELECT ?value WHERE { ?resource swa:shapesForNode ?shape . ?shape sh:property|sh:parameter ?propertyShape . ?propertyShape sh:path ?path . ?path sh:inversePath ?predicate . ?propertyShape ?property ?value . FILTER isBlank(?path) . FILTER NOT EXISTS { ?propertyShape sh:deactivated true . } . }
Checks whether a given class is "abstract" which means that it should not have any direct instances. The is true if the class either has dash:abstract, spin:abstract or ui:abstract set to true.
arg:class (rdfs:Resource): The class to check.
|
ASK WHERE { ?class (dash:abstract|spin:abstract)|ui:abstract true . }
Checks whether a given resource (typically the range of a property) is a datatype. It must either be equal to rdfs:Literal or an instance of rdfs:Datatype.
arg:range (rdfs:Resource): The range to check.
|
ASK WHERE { FILTER bound(?range) . FILTER ((?range = rdfs:Literal) || EXISTS { ?range a rdfs:Datatype . }) . }
Checks whether a given resource is "imported", which is defined to be true if the resource has at least one rdf:type triple that is read-only.
arg:resource (rdfs:Resource): The resource to check.
|
ASK WHERE { ?resource a ?type . FILTER spif:isReadOnlyTriple(?resource, rdf:type, ?type) . }
Checks whether a given property is being computed by inference (from SHACL triple rules) for a given subject.
arg:predicate (rdf:Property): The property to check.
|
arg:subject (rdfs:Resource): The subject resource.
|
ASK WHERE { ?rule sh:predicate ?predicate . ?rule sh:subject sh:this . ?shape sh:rule ?rule . FILTER NOT EXISTS { ?rule sh:deactivated true . } . FILTER tosh:isInTargetOf(?subject, ?shape) . }
Checks whether a given subject/predicate combination requires at least one value, according to the ontology. This checks for owl:minCardinality|owl:cardinality|owl:qualifiedCardinality restrictions and sh:minCount constraints.
arg:property (rdf:Property): The property to check.
|
arg:subject (rdfs:Resource): [Optional] The subject - may be unbound to fall back to the subjectType.
|
ASK WHERE { FILTER (swa:isMandatoryInOWL(?property, ?subject) || swa:isMandatoryInSHACL(?property, ?subject)) . }
arg:property (rdf:Property): The property to check.
|
arg:subject (rdfs:Resource): [Optional] The subject - may be unbound to fall back to the subjectType.
|
ASK WHERE { ?subject swa:shapesForNodeFiltered ?shape . ?shape sh:property ?propertyShape . ?propertyShape sh:path ?property . ?propertyShape sh:minCount ?minCount . FILTER (?minCount > 0) . }
Checks whether a given subject/predicate combination can have multiple values, according to the ontology. This checks for owl:maxCardinality restrictions, existing spl:Argument constraints and whether the property is functional. Note that TopBraid Suite uses a native (optimized) implementation of this function, i.e. the SPIN body is never called when used inside of TopBraid Suite.
arg:property (rdf:Property): The property to check.
|
arg:subject (rdfs:Resource): [Optional] The subject - may be unbound to fall back to the subjectType.
|
ASK WHERE { FILTER NOT EXISTS { ?property a owl:FunctionalProperty . } . BIND (swa:resourceType(?subject) AS ?class) . BIND (swa:owlMaxCardinality(?class, ?property) AS ?max) . FILTER ((!bound(?max)) || (?max > 1)) . BIND (swa:splArgumentOnProperty(?class, ?property) AS ?arg) . FILTER (!bound(?arg)) . }
Can be used as filter function in swa:SubjectsGroup to suppress an "Incoming References" widget for properties already inserted via SHACL property groups.
arg:predicate (rdf:Property): The predicate to look for.
|
arg:resource (rdfs:Resource): The (object) resource.
|
ASK WHERE { FILTER NOT EXISTS { ?resource swa:shapesForNodeFiltered ?shape . ?shape sh:property ?ps . ?ps sh:path ?inversePath . FILTER isBlank(?inversePath) . FILTER EXISTS { ?ps sh:group ?anyGroup . } . ?inversePath sh:inversePath ?predicate . } . }
Checks whether a given resource is an "ontology resource", which is either a class, property or shape. This can be used to determine whether a resource should become editable on a form, depending on whether the current vocabulary is supposed to only contain individuals.
arg:resource (rdfs:Resource): The resource to check.
|
ASK WHERE { FILTER ((spl:instanceOf(?resource, rdfs:Class) || spl:instanceOf(?resource, rdf:Property)) || spl:instanceOf(?resource, sh:Shape)) . }
Checks whether a given node would be a valid object for a given subject/predicate combination, based on SHACL constraints. This will walk through all applicable property constraints at shapes that have the subject in its target. From those, it will currently only look for sh:not shapes.
arg:object: The object to check.
|
arg:predicate (rdfs:Resource): The predicate to check.
|
arg:subject (rdfs:Resource): The subject to check at.
|
ASK WHERE { FILTER NOT EXISTS { ?subject swa:shapesForNodeFiltered ?shape . ?shape sh:property ?propertyShape . ?propertyShape sh:path ?predicate . ?propertyShape sh:not ?not . FILTER tosh:hasShape(?object, ?not) . } . }
Calls ui:label in the context of a given graph.
arg:resource (rdfs:Resource):
|
arg:resourceGraph (rdfs:Resource): The graph to operate on.
|
SELECT ?label WHERE { GRAPH ?resourceGraph { BIND (ui:label(?resource) AS ?label) . } . }
Binds the variable on the left with all letters from A-Z.
SELECT ?letter WHERE { BIND ("ABCDEFGHIJKLMNOPQRSTUVWXYZ" AS ?str) . BIND (fn:string-length(?str) AS ?length) . ?x spif:for ( 1 ?length ) . BIND (fn:substring(?str, ?x, 1) AS ?letter) . }
Produces a line break (\n) character.
SELECT ?result WHERE { BIND ("\n" AS ?result) . }
Gets the declared type of list members for a given rdf:List-valued property at a given subject. This looks for SHACL patterns, currently limited to sh:property rdf:rest*/rdf:first combined with sh:datatype or sh:class.
arg:property (rdf:Property): The rdf:List-valued property.
|
arg:subject (rdfs:Resource): The subject to get the member type of.
|
SELECT ?result WHERE { ?subject swa:shapesForNodeFiltered ?shape . ?shape sh:property|sh:parameter ?propertyShape . ?propertyShape sh:path ?property . ?propertyShape sh:property ?nested . ?nested sh:path ?sequence . ?sequence rdf:first ?first . ?first sh:zeroOrMorePath rdf:rest . ?sequence rdf:rest ?rest . ?rest rdf:first rdf:first . ?nested sh:datatype|sh:class ?result . }
Checks if a given class has multiple "ranges" for a given property, defined via sh:or constraints at the nearest shape, and returns that sh:or if it does. Otherwise, returns nothing.
arg:class (rdfs:Class): The class to start traversal at.
|
arg:property (rdf:Property): The property to get the local range of.
|
Collects all values (objects) of a given subject/predicate combination into a single string list, separated by commas. If there is just a single literal value, then return that value in the original data type. Used by SWA search forms to display optional (key) columns.
sp:arg1 (rdfs:Resource): The subject to get the objects of.
|
sp:arg2 (rdf:Property): The predicate to get the objects of.
|
Produces an ordered iterator over the ui:labels of the objects of a given subject/predicate combination. This is required by swa:objectsList because the GROUP_CONCAT is applied before ORDER BY (probably a Jena bug).
sp:arg1 (rdfs:Resource): The subject to get the objects of.
|
sp:arg2 (rdf:Property): The predicate
|
SELECT ?label WHERE { ?arg1 ?arg2 ?value . BIND (ui:label(?value) AS ?label) . } ORDER BY (?label)
Produces an ordered iterator over the ui:labels of the subjects of a given object/predicate combination. This is required by swa:subjectsList because the GROUP_CONCAT is applied before ORDER BY (probably a Jena bug).
sp:arg1 (rdfs:Resource): The object to get the subjects of.
|
sp:arg2 (rdf:Property): The predicate
|
SELECT ?label WHERE { ?value ?arg2 ?arg1 . BIND (ui:label(?value) AS ?label) . } ORDER BY (?label)
Walks up the class tree to find the closest owl:maxCardinality or owl:cardinality restriction on a given property.
arg:class (rdfs:Class): The class to get cardinality at.
|
arg:property (rdf:Property): The property to get the cardinality of.
|
SELECT ?c WHERE { ?class (rdfs:subClassOf)* ?superClass . ?superClass owl:onProperty ?property . ?superClass owl:cardinality|owl:maxCardinality ?c . }
Gets all predicates that are in a given group (?arg1) at a given focus node (?arg2). If no focus node is given, it will use the context variable that is also used by swa:resourceType(). The right hand side must be a list of three unbound variables - the first will contain the predicate, the second the predicate's label and the third is a boolean that is true if the path was walked in inverse direction. This magic property is implemented natively by TopBraid for performance reasons.
sp:arg1 (sh:PropertyGroup): The property group to get the predicate of.
|
sp:arg2: [Optional] The focus node or unbound.
|
Gets the primary key property for a given class or its superclasses - either defined using SPIN or DASH.
arg:class (rdfs:Class): The class to get the primary key of.
|
SELECT ?property WHERE { { ?class (rdfs:subClassOf)* ?type . ?type spin:constraint ?constraint . ?constraint a spl:PrimaryKeyPropertyConstraint . ?constraint arg:property ?property . } UNION { ?class (rdfs:subClassOf)* ?type . ?type sh:property ?ps . ?ps dash:uriStart ?uriStart . ?ps sh:path ?property . FILTER isIRI(?property) . } . }
Gets the URI start of the primary key for a given class or its superclasses - either defined using SPIN or DASH.
arg:class (rdfs:Class): The class to get the primary key of.
|
SELECT ?uriStart WHERE { { ?class (rdfs:subClassOf)* ?type . ?type spin:constraint ?constraint . ?constraint a spl:PrimaryKeyPropertyConstraint . ?constraint arg:uriStart ?uriStart . } UNION { ?class (rdfs:subClassOf)* ?type . ?type sh:property ?ps . ?ps dash:uriStart ?uriStart . } . }
Gets the display comment of a property in the context of a given node, falling back to swa:resourceType() if no node is provided. This is usually the rdfs:comment of the property but may be the sh:description if a suitable shape exists. This function is natively implemented for performance reasons.
arg:property (rdf:Property): The property to get the comment of.
|
arg:type: The node for the context.
|
Gets a tosh:editWidget defined for a given property at a given focus node.
arg:focusNode: The focus node.
|
arg:property (rdf:Property): The predicate to get the widget for.
|
SELECT ?result WHERE { BIND (swa:propertyShapePropertyAtNode(?property, tosh:editWidget, ?focusNode) AS ?result) . }
Gets all sh:PropertyGroups associated with a given node via property constraints, falling back to swa:resourceType() if no node is provided. This is walking up the class hierarchy for any shapes that are in target, then walks the property constraint and parameter declarations of these shapes to find sh:groups.
sp:arg1 (rdfs:Resource): The resource to get the property groups for.
|
SELECT DISTINCT ?group WHERE { { ?arg1 swa:shapesForNodeFiltered ?shape . ?shape sh:property|sh:parameter ?propertyShape . } . ?propertyShape sh:group ?group . FILTER (!dash:isDeactivated(?propertyShape)) . }
Gets the display label of a property in the context of a given class or shape. This is usually the rdfs:label of the property but may be the sh:name if a suitable shape exists. This function is natively implemented for performance reasons.
arg:property (rdfs:Property): The property to get the label of.
|
arg:theClassOrShape: The class/shape for the context.
|
Gets the display label of a property in the context of a given node, falling back to swa:resourceType() if no node is given. This is usually the rdfs:label of the property but may be the sh:name if a suitable shape exists. This function is natively implemented for performance reasons.
sp:arg1 (rdf:Property): The property.
|
sp:arg2: The focus node, for context.
|
Gets the "first" value of a given property (such as sh:name) from all shapes associated with a given shape or class.
arg:predicate (rdf:Property): The constrained property (value of sh:path).
|
arg:property (rdf:Property): The property to get, e.g. sh:order.
|
arg:resourceType (rdfs:Class): The class.
|
SELECT ?value WHERE { ?resourceType swa:shapesForType ?shape . ?shape sh:property|sh:parameter ?propertyShape . ?propertyShape sh:path ?predicate . ?propertyShape ?property ?value . }
Gets the "first" value of a given property (such as sh:name) from all shapes associated with a given shape or class, for a given inverse predicate.
arg:predicate (rdf:Property): The constrained property (value of sh:path).
|
arg:property (rdf:Property): The property to get, e.g. sh:order.
|
arg:resourceType (rdfs:Class): The class.
|
SELECT ?value WHERE { ?resourceType swa:shapesForType ?shape . ?shape sh:property|sh:parameter ?propertyShape . ?propertyShape sh:path ?path . ?path sh:inversePath ?predicate . ?propertyShape ?property ?value . }
Gets the "first" value of a given property (such as sh:name) from all shapes associated with a given focus node. If the focus node is unbound (e.g. in search forms), this falls back to the swa:resourceTypes.
arg:predicate (rdf:Property): The constrained property (value of sh:path).
|
arg:property (rdf:Property): The property to get, e.g. sh:order.
|
arg:resource (rdfs:Resource): [Optional] The focus node or unbound.
|
SELECT ?value WHERE { ?resource swa:shapesForNode ?shape . ?shape sh:property|sh:parameter ?propertyShape . ?propertyShape sh:path ?predicate . ?propertyShape ?property ?value . }
Gets a tosh:viewWidget defined for a given property at a given focus node.
arg:focusNode: The focus node.
|
arg:property (rdf:Property): The predicate to get the widget for.
|
SELECT ?result WHERE { BIND (swa:propertyShapePropertyAtNode(?property, tosh:viewWidget, ?focusNode) AS ?result) . }
Finds the properties that are attached to a given class or its superclasses.
sp:arg1 (rdfs:Class): The class to get the properties of.
|
SELECT DISTINCT ?property WHERE { ?arg1 (rdfs:subClassOf)* ?cls . ?cls swa:directRelevantClassOfProperty ?property . }
Gets all rdf:types of a resource. The resource may actually not be given (e.g. when we are populating a Search form), in which case it will try to find the value of the context variable "resourceType", which is set by the surrounding form. If none of these are present, it falls back to rdfs:Resource.
sp:arg1 (rdfs:Resource): [Optional] The resource to get the types of, or unbound to fall back to the context value.
|
SELECT ?result WHERE { { { FILTER (bound(?arg1) && EXISTS { ?arg1 a ?any . }) . } . ?arg1 a ?result . } UNION { FILTER ((!bound(?arg1)) || NOT EXISTS { ?arg1 a ?any . }) . BIND (COALESCE(ui:contextValue("resourceType"), rdfs:Resource) AS ?result) . } . }
Gets all sh:Shapes associated with a given (focus) node. This is looking at the swa:resourceTypes of the node and then walks up the class hierarchy and collects all classes that are also instances of sh:Shape, and any shapes declared using sh:targetClass. Future versions will also be looking for sh:targetObjectsOf triples.
sp:arg1 (rdfs:Resource): The focus node.
|
SELECT DISTINCT ?shape WHERE { ?arg1 swa:resourceTypes ?type . ?type swa:shapesForType ?shape . }
Same as swa:shapesForNode but only returning the non-deactivated shapes.
sp:arg1 (rdfs:Resource): The focus node.
|
SELECT DISTINCT ?shape WHERE { ?arg1 swa:shapesForNode ?shape . FILTER (!dash:isDeactivated(?shape)) . }
Gets all sh:Shapes associated with a given type. This is walking up the class hierarchy and collects all classes that are also instances of sh:Shape, and any shapes declared using sh:targetClass. In TopBraid, this magic property is implemented as a native Java function for performance reasons.
sp:arg1 (rdfs:Class): The type to get the shapes for.
|
SELECT DISTINCT ?shape WHERE { ?arg1 (rdfs:subClassOf)* ?type . { ?shape sh:targetClass ?type . } UNION { FILTER spl:instanceOf(?type, sh:Shape) . BIND (?type AS ?shape) . } . }
Attempts to find one or more shortests paths between two given RDF nodes in the current query graph. A path is a chain of triples, walked in either direction from a start node to an end node. It is strongly advised that the algorithm is limited by path length to prevent potential complete graph traversals. Syntax: ( ?start ?end ?maxCount ?maxLength [?pred1 ?pred2...] ) swa:shortestPathsBetweenNodes ( ?value ?predicate ?inverse ?stepIndex ?pathIndex ) Input values (left hand side): ?start - the start node (must be bound) ?end - the end node (must be bound) ?maxCount - the maximum number of paths to return (optional, defaults to 1) ?maxLength - the maximum length/depth of traversal (optional, defaults to 5) ?predX - the predicates to use, or none for any predicate Output values (all unbound variables on the right hand side, each result row represents one step in a path): ?value - the value node that was reached from the previous node ?predicate - the predicate that was used to reach ?value from the previous node ?inverse - true if ?predicate was walked from object to subject, false for subject to object (optional) ?stepIndex - the index of the step within its path (optional, starting at 0) ?pathIndex - the index of the path for cases where multiple paths are returned (optional, starting at 0)
sp:arg1: The start node (must be concrete).
|
sp:arg2: The end node (must be concrete).
|
sp:arg3 (xsd:integer): [Optional] The maximum number of results to return. Defaults to 1.
|
sp:arg4 (xsd:integer): [Optional] The maximum length/depth of traversal, defaults to 5.
|
Gets the predicate of the parameter if a constraint component has exactly one parameter.
arg:component (rdfs:Resource): The constraint component.
|
SELECT ?predicate WHERE { ?component sh:parameter/sh:path ?predicate . FILTER (isIRI(?predicate) && NOT EXISTS { ?component sh:parameter/sh:path ?other . FILTER (?other != ?predicate) . }) . }
Collects all subjects of a given object/predicate combination into a single string list, separated by commas. Used by SWA search forms to display optional (key) columns.
sp:arg1 (rdfs:Resource): The object to get the subjects of.
|
sp:arg2 (rdf:Property): The predicate to get the objects of.
|
SELECT (GROUP_CONCAT(?label; SEPARATOR=', ') AS ?result) WHERE { ( ?arg1 ?arg2 ) swa:orderedSubjectLabels ?label . } ORDER BY (?label)
For a given resource (left hand side), this returns all direct rdf:types (right hand side), dropping any types that are superclasses of these direct types. For example, if a property has rdf:types owl:AnnotationProperty and rdf:Property, then the rdf:Property triple will not be returned because rdf:Property is a super-property of owl:AnnotationProperty.
sp:arg1 (rdfs:Resource): The subject resource.
|
SELECT ?type WHERE { ?arg1 a ?type . FILTER NOT EXISTS { ?arg1 a ?otherType . FILTER (?type != ?otherType) . ?otherType (rdfs:subClassOf)+ ?type . } . }
Similar to spl:object, but executed within the ui:graph.
sp:arg1 (rdfs:Resource): The subject.
|
sp:arg2 (rdf:Property): The predicate.
|
SELECT ?object WHERE { GRAPH ui:graph { BIND (spl:object(?arg1, ?arg2) AS ?object) . } . }
Can be used in conjunction with ui:preCondition to check whether a given URI has already been used in the current query graph.
arg:resource (rdfs:Resource): The resource to check.
|
SELECT ?message WHERE { FILTER (EXISTS { ?resource ?p ?o . } || EXISTS { ?s ?p ?resource . }) . BIND (fn:concat("The URI ", xsd:string(?resource), " is already used.") AS ?message) . }
Can be used with ui:preCondition to check whether a given string is a valid URI.
sp:arg1 (xsd:string): The argument string.
|
SELECT ?result WHERE { FILTER (!spif:isValidURI(?arg1)) . BIND (fn:concat("Not a well-formed absolute URI: ", ?arg1) AS ?result) . }
Makes it possible to query for the arguments of the current UISPIN element of a user-defined class. The argument on the left side must be an rdf:Property or a variable. The right side must be an unbound variable, that will contain the value of the argument at the current context node.
Gets the URI of the base graph of a graph previously created with ui:unionOfGraphs.
arg:unionGraph (rdfs:Resource): The union graph to get the base graph of.
|
Checks whether a given literal can be parsed using ui:parse. Returns false if the given literal cannot be parsed as HTML (default) or XML (if second argument is true).
arg:node: The RDF node to test. Must be a literal that can be parsed as HTML or XML.
|
arg:xml (xsd:boolean): [Optional] True to do the parsing in XML only, while the default is to do permissive HTML parsing.
|
Gets the SWP element that will be used by a ui:classView element for a given class and optional matchIds. The result is the SWP node (often a blank node) or unbound. More information about that SWP node can be queried in the ui:graph.
arg:class (rdfs:Class): The class to get the view element of.
|
arg:matchIds (xsd:string): [Optional] Optional match IDs.
|
Creates a string by concatenating the string representation of its arguments from left to right. This is basically identical to the SPARQL built-in CONCAT, with the important difference that unbound variables will be ignored without failure. The function is also used by the SWP parser if a user enters mixed attribute values such as arg="Hello, {= ?name }" which is mapped to ui:concat('Hello, ', ?name).
Gets the value of a given context variable that was set before using ui:setContext. For example, <ui:setContext ui:varName="test" ui:value="Hello">...</ui:setContext> makes the name-value-pair test="Hello" visible for all children of the setContext element.
sp:arg1 (xsd:string): The name of the variable to get.
|
Take a literal containing HTML mark-up and removes any HTML elements (tags), while preserving some of the formatting using regular text. Note that by default this function returns the input node unless the datatype of the literal is rdf:HTML or the second argument is set to true.
arg:html (rdfs:Literal): The HTML text to convert.
|
arg:treatAnyLiteral (xsd:boolean): [Optional] True to convert any literal. By default (or false), only literals that have datatype rdf:HTML will be converted.
|
Creates a (temporary) graph that can be accessed across multiple server call-backs, as long as a client session is active. The new graph is initially empty but can be populated using ui:update. Optionally, you can specify a base graph that will be a sub-graph of the new graph. The life cycle of a session graph ends if ui:deleteSessionGraph is called or a time out happens (after idle time).
arg:baseGraph (rdfs:Resource): [Optional] An optional graph that should be included as subgraph into the session graph.
|
Gets the URI resource of the currently active query graph.
Creates an RDF node from a string representation created with ui:encodeNode. This basically turns a qname back into a URI etc.
sp:arg1 (xsd:string): The id of the RDF node to decode.
|
Deletes a session graph that was previously created using ui:createSessionGraph. The function has side effects to the state of the SWP engine, but returns a dummy boolean (true) if the operation is succesful.
arg:sessionGraph (rdfs:Resource): The graph to delete.
|
Creates a URL-encoded string consisting of name-value pairs based on the current SWP context variable bindings, that the SWP servlet can use to initialize context variables for its current request. This can be used to hand-code context-sensitive Ajax loading similar to how ui:loadable does it. In a typical scenario, the result of this function would be stored as a "hidden" attribute in the DOM tree, and then added to the request URL (parameters) when needed.
Creates a string representation of a given RDF node (?arg1). By default this is using qnames where possible, unless the optional third argument is set to true.
sp:arg1: The node to encode.
|
sp:arg2 (xsd:boolean): [Optional] True to have round-trippable blank nodes. Will encode them as <@ID>.
|
sp:arg3 (xsd:boolean): [Optional] true to not use qnames for URI nodes.
|
Encodes a given string so that it can be made part of a well-formed URL, e.g. in server callbacks.
sp:arg1: The string or URI resource to encode.
|
Converts a given string to a JSON-friendly string that can be sent across the wire. In particular, this replaces " with \" so that string literals can be put between matching " braces.
sp:arg1 (xsd:string): The string to escape.
|
Creates the source code of a JavaScript function call. The first argument is the function name, all others are rendered into comma-separated arguments. The function takes care of correct escaping. URI resources are turned into strings of their URI.
sp:arg1 (xsd:string): The function name without the round brackets, e.g. "$('#input').val".
|
ui:functionCall("test", "Hello \"", 42, false, owl:Thing)
Gets an attribute of the currently active client session.
sp:arg1 (xsd:string): The name of the attribute to get.
|
Gets the value of a global variable.
ui:name (xsd:string): The name of the variable to get.
|
SELECT ?object WHERE { GRAPH ui:tempGraphGlobalVars { BIND (ui:GlobalVars AS ?subject) . BIND (IRI(CONCAT("urn:x-global-var:", ?name)) AS ?predicate) . BIND (spl:object(?subject, ?predicate) AS ?object) . } . }
Casts a given named graph resource to an encoded resource that instructs the engine to also include the owl:imports closure (and the system graph). Details of how to encode such resources are left to the engine but need to be consistent with the sibling function ui:graphWithoutImports. Returns the original graph unchanged if it already has the additional encoding.
sp:arg1 (rdfs:Resource): The graph resource to cast.
|
Opposite of ui:graphWithImports.
sp:arg1 (rdfs:Resource): The graph resource to cast.
|
Iterates over a given "native" JSON array (left hand side) producing bindings for the variable on the right hand side.
sp:arg1: The JSON array.
|
Binds the keys of a JSON object on the left hand side to the variable on the right.
sp:arg1: The JSON object.
|
Turns a "native" JSON value into an RDF string literal.
arg:jsonValue: The JSON value node.
|
Gets the value of a "native" JSON object, as another "native" JSON value.
arg:jsonObject: The "native" JSON object to get the value of.
|
arg:key (xsd:string): The key of the JSON value to get at the JSON object.
|
Computes the display label for a given RDF node (literal or resource). For resources, this typically uses the rdfs:label (or sub-property thereof). However, this behavior can be customized with a global setting to redirect ui:label to a different string-producing function. Deeper sub-properties are preferred over their super-properties. For some literal types such as xsd:date and xsd:float, this uses localization settings based on ui:lang(), e.g. "4.2"^^xsd:float is rendered as 4,2 when the current language is "de". For all other literal datatypes, the plain lexical form of the literal is put out.
sp:arg1: The node to get the label of.
|
sp:arg2 (xsd:string): [Optional] An optional style that is used by the date/time literal types. Currently supported values are: "short", "medium", "long" and "full".
|
Gets the language that shall be used in the current request. The language is in the same format as the RDF language tags. It is usually specified by the system as part of the incoming client request. It is also possible to explicitly set the language for child element using ui:setContext.
Creates the start of the "lib" servlet that is used to access static files within the SWP servlet. Instead of hard-coding this (e.g. "lib/assets/js/swa.js") you should always use this function to resolve the first segment, e.g. "{= ui:lib() }/assets/js/swa.js". This allows the engine to inject additional info such as the version number into the path.
SELECT ?result WHERE { BIND ("lib" AS ?result) . }
Walks up the hierarchy of parent views starting with the current view, and finds the first parent that has a given rdf:type.
arg:type (rdfs:Resource): The type of the parent.
|
Gets the value of a parameter passed in as part of the current HTTP request. Optionally, the parameter can be cast into a given type. The returned value is escaped in SPARQL syntax.
arg:name (xsd:string): The name of the parameter.
|
arg:type (rdfs:Class): [Optional] The type to cast the string to (defaults to xsd:string).
|
Gets the names of all parameters to the current servlet request. See ui:param to access the actual value of each parameter. Usage: SELECT ?key ?value WHERE { () ui:params ?key . BIND (ui:param(?key) AS ?value) . }
A property function that returns the current status of a long-running process, as reported by the process in the <ui:task> and <ui:subTask> control elements. Synax: ?progressId ui:progressMonitorStatus ( ?task ?subTask ?totalWork ?completedWork ) . The subject must be a concrete URI or literal, or a variable bound to one. All members of the object list must be unbound variables. ?progressId - the identifier of the long-running process, e.g., the _progressId argument passed to the SWP servlet ?task - a label for the long-running task ?subTask - a label for the currently executing sub-task ?totalWork - an integer indicating the total number of work units in the task ?completedWork - an integer indicating the number of completed work units
Gets the SWP element that will be used by a ui:resourceView element for a given resource and optional matchIds. The result is the SWP node (often a blank node) or unbound. More information about that SWP node can be queried in the ui:graph.
arg:matchIds (xsd:string): [Optional] Optional match IDs.
|
arg:resource (rdfs:Resource): The resource to get the view element of.
|
Gets the server as returned by the currently running SWP engine.
Sets an attribute of the currently active client session. This makes it possible to maintain state while the user is clicking between multiple SWP pages in the browser. The result of the function itself is the empty string.
sp:arg1 (xsd:string): The name of the attribute to set.
|
sp:arg2 (xsd:string): The new value of the attribute.
|
Gets a system preference set by the UISPIN execution environment. These are typically server-specific settings such as how to redirect hyperlinks, or Google API keys, that can be queried by UISPIN elements to adjust the page generation.
sp:arg1 (xsd:string): The name of the preference to get.
|
Takes one or more URI resources of named graphs and produces a new URI resource describing a graph that will be recognized by the engine as the union of the named graphs. This can be used to construct temporary query graphs and pass them around with a well-defined URI. All arguments must be URI resources - there can be any number of them. Use ui:baseGraph() for the "reverse" of this operation.
Takes a result set listing a collection of graph nodes (URI resources) and produces a new URI resource describing a graph that will be recognized by the engine as the union of those named graphs. This can be used to construct temporary query graphs and pass them around with a well-defined URI. This function can only be used inside of an executing SWP engine, because it needs to access the result set object. Use ui:baseGraph() for the "reverse" of this operation.
arg:resultSet (spr:Table): The SPR result set to walk through.
|
Generates a string identifier that is unique for the life time of the UISPIN execution engine.
As a SPARQL function, this converts a given node (?arg1) to an xsd:boolean literal.
sp:arg1: The input value.
|
As a SPARQL function, this converts a given node (?arg1) to an xsd:date literal.
sp:arg1: The input value.
|
As a SPARQL function, this converts a given node (?arg1) to an xsd:dateTime literal.
sp:arg1: The input value.
|
sp:arg1: The input value.
|
As a SPARQL function, this converts a given node (?arg1) to an xsd:float literal.
sp:arg1: The input value.
|
As a SPARQL function, this converts a given node (?arg1) to an xsd:integer literal.
sp:arg1: The input value.
|
As a SPARQL function, this converts a given node (?arg1) to an xsd:string literal. If the input is a resource, then the URI of that resource will be returned.
sp:arg1: The input node.
|
As a SPARQL function, this converts a given node (?arg1) to an xsd:time literal.
sp:arg1: The input value.
|