Skip to content

SPARQL functions ontology

Link
Ontology IRI https://w3id.org/rdf-tensor/functions
Supports content negotiation
Turtle https://w3id.org/rdf-tensor/functions.ttl
N-Triples https://w3id.org/rdf-tensor/functions.nt
Jelly https://w3id.org/rdf-tensor/functions.jelly
JSON-LD https://w3id.org/rdf-tensor/functions.jsonld
RDF/XML https://w3id.org/rdf-tensor/functions.rdf

Ontology source (LinkML)

Source file.

This LinkML source is converted to RDFS using LinkML-Scala.

id: https://w3id.org/rdf-tensor/functions
name: rdf-tensor-functions
title: RDF-tensor SPARQL functions
description: SPARQL functions for processing data tensors.
imports:
  - linkml:types
prefixes:
  tensor: https://w3id.org/rdf-tensor/vocab#
  rdfs: http://www.w3.org/2000/01/rdf-schema#
  sd: http://www.w3.org/ns/sparql-service-description#
  dcterms: http://purl.org/dc/terms/
  linkml: https://w3id.org/linkml/
default_prefix: tensor
default_range: string
license: https://www.apache.org/licenses/LICENSE-2.0
contributors:
  - https://github.com/cinekele
  - https://github.com/Ostrzyciel
  - https://github.com/nk2ishere
emit_prefixes:
  - tensor
  - sd
enums:
  TensorFunctions:
    enum_uri: sd:Function
    permissible_values:
      "cos":
        meaning: tensor:cos
        title: "Cosine"
        description: "Computes the cosine of each element in the numerical tensor."
        created_by: https://github.com/cinekele
      "exp":
        meaning: tensor:exp
        title: "Exponential"
        description: "Applies the exponential function to each element."
        created_by: https://github.com/cinekele
      "log":
        meaning: tensor:log
        title: "Natural Logarithm"
        description: "Applies the natural logarithm to each element."
        created_by: https://github.com/cinekele
      "logp":
        meaning: tensor:logp
        title: "Logarithm with Base p"
        description: "Applies logarithm with specified base p."
        created_by: https://github.com/cinekele
      "poly":
        meaning: tensor:poly
        title: "Polynomial Power"
        description: "Raises each element to a specified power."
        created_by: https://github.com/cinekele
      "scale":
        meaning: tensor:scale
        title: "Scale"
        description: "Scales tensor elements by a constant."
        created_by: https://github.com/cinekele
      "sin":
        meaning: tensor:sin
        title: "Sine"
        description: "Computes the sine of each element in the numerical tensor."
        created_by: https://github.com/cinekele
      "abs":
        meaning: tensor:abs
        title: "Absolute Value"
        description: "Applies absolute value to each element."
        created_by: https://github.com/cinekele
      "cast":
        meaning: tensor:cast
        title: "Type Cast"
        description: "Casts tensor elements to a specified data type."
        created_by: https://github.com/cinekele
      "reshape":
        meaning: tensor:reshape
        title: "Reshape Tensor"
        description: "Reshapes a tensor to a new shape."
        created_by: https://github.com/nk2ishere
      "not":
        meaning: tensor:not
        title: "Logical NOT"
        description: "Computes the logical negation of each boolean tensor element."
        created_by: https://github.com/cinekele
      "add":
        meaning: tensor:add
        title: "Addition"
        description: "Adds two numerical tensors element-wise."
        created_by: https://github.com/cinekele
      "subtract":
        meaning: tensor:subtract
        title: "Subtraction"
        description: "Subtracts the second numerical tensor from the first element-wise."
        created_by: https://github.com/cinekele
      "multiply":
        meaning: tensor:multiply
        title: "Multiplication"
        description: "Multiplies two numerical tensors element-wise."
        created_by: https://github.com/cinekele
      "divide":
        meaning: tensor:divide
        title: "Division"
        description: "Divides the first numerical tensor by the second element-wise."
        created_by: https://github.com/cinekele
      "eq":
        meaning: tensor:eq
        title: "Equality Check"
        description: "Checks if elements in two tensors are equal."
        created_by: https://github.com/cinekele
      "neq":
        meaning: tensor:neq
        title: "Inequality Check"
        description: "Checks if elements in two tensors are not equal."
        created_by: https://github.com/cinekele
      "and":
        meaning: tensor:and
        title: "Logical AND"
        description: "Performs element-wise logical AND on boolean tensors."
        created_by: https://github.com/cinekele
      "or":
        meaning: tensor:or
        title: "Logical OR"
        description: "Performs element-wise logical OR on boolean tensors."
        created_by: https://github.com/cinekele
      "gt":
        meaning: tensor:gt
        title: "Greater Than"
        description: "Compares if first tensor is greater than the second element-wise."
        created_by: https://github.com/cinekele
      "lt":
        meaning: tensor:lt
        title: "Less Than"
        description: "Compares if first tensor is less than the second element-wise."
        created_by: https://github.com/cinekele
      "sub":
        meaning: tensor:sub
        title: "Get Sub-Tensor"
        description: "Extracts a sub-tensor based on an index tensor."
        created_by: https://github.com/cinekele
      "mask":
        meaning: tensor:mask
        title: "Mask Tensor"
        description: "Extracts elements from a tensor using a boolean mask tensor."
        created_by: https://github.com/nk2ishere
      "index":
        meaning: tensor:index
        title: "Get From Tensor By Index"
        description: "Extracts elements from a tensor using an index tensor."
        created_by: https://github.com/nk2ishere
      "concat":
        meaning: tensor:concat
        title: "Concatenate Tensors"
        description: "Concatenates multiple tensors optionally along a specified dimension."
        created_by: https://github.com/cinekele
      "hstack":
        meaning: tensor:hstack
        title: "Horizontal Stack"
        description: "Stacks multiple tensors horizontally (along axis 1)."
        created_by: https://github.com/cinekele
      "vstack":
        meaning: tensor:vstack
        title: "Vertical Stack"
        description: "Stacks multiple tensors vertically (along axis 0)."
        created_by: https://github.com/cinekele
      "all":
        meaning: tensor:all
        title: "All True"
        description: "Checks whether all elements in a boolean tensor are true."
        created_by: https://github.com/cinekele
      "any":
        meaning: tensor:any
        title: "Any True"
        description: "Checks whether any element in a boolean tensor is true."
        created_by: https://github.com/cinekele
      "none":
        meaning: tensor:none
        title: "None True"
        description: "Checks whether no elements in a boolean tensor are non-zero or true."
        created_by: https://github.com/nk2ishere
      "avg":
        meaning: tensor:avg
        title: "Average"
        description: "Computes the average along a specified axis."
        created_by: https://github.com/cinekele
      "sum":
        meaning: tensor:sum
        title: "Sum"
        description: "Computes the sum along a specified axis."
        created_by: https://github.com/cinekele
      "prod":
        meaning: tensor:prod
        title: "Product"
        description: "Computes the product along a specified axis."
        created_by: https://github.com/nk2ishere
      "max":
        meaning: tensor:max
        title: "Maximum"
        description: "Computes the maximum along a specified axis."
        created_by: https://github.com/cinekele
      "min":
        meaning: tensor:min
        title: "Minimum"
        description: "Computes the minimum along a specified axis."
        created_by: https://github.com/cinekele
      "std":
        meaning: tensor:std
        title: "Standard Deviation"
        description: "Computes the standard deviation along a specified axis."
        created_by: https://github.com/cinekele
      "var":
        meaning: tensor:var
        title: "Variance"
        description: "Computes the variance along a specified axis."
        created_by: https://github.com/cinekele
      "norm1":
        meaning: tensor:norm1
        title: "L1 Norm"
        description: "Computes the L1 norm along a specified axis."
        created_by: https://github.com/cinekele
      "norm2":
        meaning: tensor:norm2
        title: "L2 Norm"
        description: "Computes the L2 norm along a specified axis."
        created_by: https://github.com/cinekele
      "cosineSimilarity":
        meaning: tensor:cosineSimilarity
        title: "Cosine Similarity"
        description: "Computes the cosine similarity between two numerical tensors."
        created_by: https://github.com/cinekele
      "euclideanDistance":
        meaning: tensor:euclideanDistance
        title: "Euclidean Distance"
        description: "Computes the Euclidean distance between two numerical tensors."
        created_by: https://github.com/cinekele
      "create":
        meaning: tensor:create
        title: "Create Tensor"
        description: "Creates a tensor from raw data and type."
        created_by: https://github.com/nk2ishere
      "transpose":
        meaning: tensor:transpose
        title: "Transpose Tensor"
        description: "Transposes a tensor by permuting its dimensions."
        created_by: https://github.com/nk2ishere
      "flatten":
        meaning: tensor:flatten
        title: "Flatten Tensor"
        description: "Flattens a tensor into a one-dimensional array."
        created_by: https://github.com/nk2ishere
      "range":
        meaning: tensor:range
        title: "Create Range"
        description: "Creates a range of values defined as full or concrete."
        created_by: https://github.com/nk2ishere
      "shape":
        meaning: tensor:shape
        title: "Get Tensor Shape"
        description: "Returns the shape of a tensor as a list of integers."
        created_by: https://github.com/nk2ishere
      "arange":
        meaning: tensor:arange
        title: "Create tensor with Range of Values"
        description: "Creates a tensor with a range of values defined by start, end, and step."
        created_by: https://github.com/nk2ishere
      "quantile":
        meaning: tensor:quantile
        title: "Quantile"
        description: "Computes the quantiles of a tensor along a specified axis."
        created_by: https://github.com/nk2ishere
      "quantileInterpolate":
        meaning: tensor:quantileInterpolate
        title: "Quantile Interpolation"
        description: "Computes the quantiles of a tensor along a specified axis using linear interpolation."
        created_by: https://github.com/nk2ishere
      "sort":
        meaning: tensor:sort
        title: "Sort Tensor"
        description: "Sorts the elements of the input tensor along the specified axis in the given direction."
        created_by: https://github.com/nk2ishere

Ontology source (Turtle)

PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>
PREFIX rdfs: <http://www.w3.org/2000/01/rdf-schema#>
PREFIX sd: <http://www.w3.org/ns/sparql-service-description#>
PREFIX tensor: <https://w3id.org/rdf-tensor/vocab#>
PREFIX xsd: <http://www.w3.org/2001/XMLSchema#>

sd:Function  rdf:type  rdfs:Class .

tensor:cos  rdf:type  sd:Function;
        rdfs:label    "Cosine";
        rdfs:comment  "Computes the cosine of each element in the numerical tensor." .

tensor:exp  rdf:type  sd:Function;
        rdfs:label    "Exponential";
        rdfs:comment  "Applies the exponential function to each element." .

tensor:log  rdf:type  sd:Function;
        rdfs:label    "Natural Logarithm";
        rdfs:comment  "Applies the natural logarithm to each element." .

tensor:logp  rdf:type  sd:Function;
        rdfs:label    "Logarithm with Base p";
        rdfs:comment  "Applies logarithm with specified base p." .

tensor:poly  rdf:type  sd:Function;
        rdfs:label    "Polynomial Power";
        rdfs:comment  "Raises each element to a specified power." .

tensor:scale  rdf:type  sd:Function;
        rdfs:label    "Scale";
        rdfs:comment  "Scales tensor elements by a constant." .

tensor:sin  rdf:type  sd:Function;
        rdfs:label    "Sine";
        rdfs:comment  "Computes the sine of each element in the numerical tensor." .

tensor:abs  rdf:type  sd:Function;
        rdfs:label    "Absolute Value";
        rdfs:comment  "Applies absolute value to each element." .

tensor:cast  rdf:type  sd:Function;
        rdfs:label    "Type Cast";
        rdfs:comment  "Casts tensor elements to a specified data type." .

tensor:reshape  rdf:type  sd:Function;
        rdfs:label    "Reshape Tensor";
        rdfs:comment  "Reshapes a tensor to a new shape." .

tensor:not  rdf:type  sd:Function;
        rdfs:label    "Logical NOT";
        rdfs:comment  "Computes the logical negation of each boolean tensor element." .

tensor:add  rdf:type  sd:Function;
        rdfs:label    "Addition";
        rdfs:comment  "Adds two numerical tensors element-wise." .

tensor:subtract  rdf:type  sd:Function;
        rdfs:label    "Subtraction";
        rdfs:comment  "Subtracts the second numerical tensor from the first element-wise." .

tensor:multiply  rdf:type  sd:Function;
        rdfs:label    "Multiplication";
        rdfs:comment  "Multiplies two numerical tensors element-wise." .

tensor:divide  rdf:type  sd:Function;
        rdfs:label    "Division";
        rdfs:comment  "Divides the first numerical tensor by the second element-wise." .

tensor:eq  rdf:type   sd:Function;
        rdfs:label    "Equality Check";
        rdfs:comment  "Checks if elements in two tensors are equal." .

tensor:neq  rdf:type  sd:Function;
        rdfs:label    "Inequality Check";
        rdfs:comment  "Checks if elements in two tensors are not equal." .

tensor:and  rdf:type  sd:Function;
        rdfs:label    "Logical AND";
        rdfs:comment  "Performs element-wise logical AND on boolean tensors." .

tensor:or  rdf:type   sd:Function;
        rdfs:label    "Logical OR";
        rdfs:comment  "Performs element-wise logical OR on boolean tensors." .

tensor:gt  rdf:type   sd:Function;
        rdfs:label    "Greater Than";
        rdfs:comment  "Compares if first tensor is greater than the second element-wise." .

tensor:lt  rdf:type   sd:Function;
        rdfs:label    "Less Than";
        rdfs:comment  "Compares if first tensor is less than the second element-wise." .

tensor:sub  rdf:type  sd:Function;
        rdfs:label    "Get Sub-Tensor";
        rdfs:comment  "Extracts a sub-tensor based on an index tensor." .

tensor:mask  rdf:type  sd:Function;
        rdfs:label    "Mask Tensor";
        rdfs:comment  "Extracts elements from a tensor using a boolean mask tensor." .

tensor:index  rdf:type  sd:Function;
        rdfs:label    "Get From Tensor By Index";
        rdfs:comment  "Extracts elements from a tensor using an index tensor." .

tensor:concat  rdf:type  sd:Function;
        rdfs:label    "Concatenate Tensors";
        rdfs:comment  "Concatenates multiple tensors optionally along a specified dimension." .

tensor:hstack  rdf:type  sd:Function;
        rdfs:label    "Horizontal Stack";
        rdfs:comment  "Stacks multiple tensors horizontally (along axis 1)." .

tensor:vstack  rdf:type  sd:Function;
        rdfs:label    "Vertical Stack";
        rdfs:comment  "Stacks multiple tensors vertically (along axis 0)." .

tensor:all  rdf:type  sd:Function;
        rdfs:label    "All True";
        rdfs:comment  "Checks whether all elements in a boolean tensor are true." .

tensor:any  rdf:type  sd:Function;
        rdfs:label    "Any True";
        rdfs:comment  "Checks whether any element in a boolean tensor is true." .

tensor:none  rdf:type  sd:Function;
        rdfs:label    "None True";
        rdfs:comment  "Checks whether no elements in a boolean tensor are non-zero or true." .

tensor:avg  rdf:type  sd:Function;
        rdfs:label    "Average";
        rdfs:comment  "Computes the average along a specified axis." .

tensor:sum  rdf:type  sd:Function;
        rdfs:label    "Sum";
        rdfs:comment  "Computes the sum along a specified axis." .

tensor:prod  rdf:type  sd:Function;
        rdfs:label    "Product";
        rdfs:comment  "Computes the product along a specified axis." .

tensor:max  rdf:type  sd:Function;
        rdfs:label    "Maximum";
        rdfs:comment  "Computes the maximum along a specified axis." .

tensor:min  rdf:type  sd:Function;
        rdfs:label    "Minimum";
        rdfs:comment  "Computes the minimum along a specified axis." .

tensor:std  rdf:type  sd:Function;
        rdfs:label    "Standard Deviation";
        rdfs:comment  "Computes the standard deviation along a specified axis." .

tensor:var  rdf:type  sd:Function;
        rdfs:label    "Variance";
        rdfs:comment  "Computes the variance along a specified axis." .

tensor:norm1  rdf:type  sd:Function;
        rdfs:label    "L1 Norm";
        rdfs:comment  "Computes the L1 norm along a specified axis." .

tensor:norm2  rdf:type  sd:Function;
        rdfs:label    "L2 Norm";
        rdfs:comment  "Computes the L2 norm along a specified axis." .

tensor:cosineSimilarity
        rdf:type      sd:Function;
        rdfs:label    "Cosine Similarity";
        rdfs:comment  "Computes the cosine similarity between two numerical tensors." .

tensor:euclideanDistance
        rdf:type      sd:Function;
        rdfs:label    "Euclidean Distance";
        rdfs:comment  "Computes the Euclidean distance between two numerical tensors." .

tensor:create  rdf:type  sd:Function;
        rdfs:label    "Create Tensor";
        rdfs:comment  "Creates a tensor from raw data and type." .

tensor:transpose  rdf:type  sd:Function;
        rdfs:label    "Transpose Tensor";
        rdfs:comment  "Transposes a tensor by permuting its dimensions." .

tensor:flatten  rdf:type  sd:Function;
        rdfs:label    "Flatten Tensor";
        rdfs:comment  "Flattens a tensor into a one-dimensional array." .

tensor:range  rdf:type  sd:Function;
        rdfs:label    "Create Range";
        rdfs:comment  "Creates a range of values defined as full or concrete." .

tensor:shape  rdf:type  sd:Function;
        rdfs:label    "Get Tensor Shape";
        rdfs:comment  "Returns the shape of a tensor as a list of integers." .

tensor:arange  rdf:type  sd:Function;
        rdfs:label    "Create tensor with Range of Values";
        rdfs:comment  "Creates a tensor with a range of values defined by start, end, and step." .

tensor:quantile  rdf:type  sd:Function;
        rdfs:label    "Quantile";
        rdfs:comment  "Computes the quantiles of a tensor along a specified axis." .

tensor:quantileInterpolate
        rdf:type      sd:Function;
        rdfs:label    "Quantile Interpolation";
        rdfs:comment  "Computes the quantiles of a tensor along a specified axis using linear interpolation." .

tensor:sort  rdf:type  sd:Function;
        rdfs:label    "Sort Tensor";
        rdfs:comment  "Sorts the elements of the input tensor along the specified axis in the given direction." .