Skip to content
Alpha: see what works today →
Menu

cascade:Server server

https://ns.cascadeprotocol.org/cascade#Server

A server a client pulled from or connected to, as a record named by cascade:ServerNamingRule. What the server reported about itself is on its versions; a server known only from a document's address has a record with none.

Type
owl:Class
Domain of
cascade:authorizationEndpoint, cascade:connectClientId, cascade:selfAssertedBaseUrl, cascade:serverSoftwareName, cascade:serverSoftwareVersion

cascade:ServerNameShape checks each cascade:Server.

PropertyValue typeHow manyWhen it is not met
cascade:serverBaseUrlat least 1 A server's record states the base URL it is named by.

On the whole node: sparql [ a sh:SPARQLConstraint; message "A server's record states its base URL normalised, and its name is the one cascade:ServerNamingRule gives that base: expected {?expected}."; severity sh:Violation; select

SELECT $this ?expected WHERE {
  $this <https://ns.cascadeprotocol.org/cascade#serverBaseUrl> ?address .
  BIND ("^([Hh][Tt][Tt][Pp][Ss]?)://([A-Za-z0-9.-]+)(:[1-9][0-9]{0,4})?((/[^/?#%]+)*)$" AS ?read)
  BIND (REPLACE(?address, ?read, "$3") AS ?port)
  BIND (REGEX(?address, ?read) && !REGEX(REPLACE(?address, ?read, "$4"), "(^|/)[.][.]?(/|$)")
        && !CONTAINS(?address, "")
        && (?port = "" || <http://www.w3.org/2001/XMLSchema#integer>(SUBSTR(?port, 2)) <= 65535) AS ?normalisable)
  BIND (LCASE(REPLACE(?address, ?read, "$1")) AS ?scheme)
  BIND (CONCAT(?scheme, "://", LCASE(REPLACE(?address, ?read, "$2")),
               IF(?port = "" || (?scheme = "http" && ?port = ":80") || (?scheme = "https" && ?port = ":443"), "", ?port),
               REPLACE(?address, ?read, "$4")) AS ?input1)
  BIND (SHA256(CONCAT("90c60849-c5ef-4ca6-bfb8-8662bd07d2b5|https://ns.cascadeprotocol.org/cascade#ServerNamingRule",
                       "|", REPLACE(REPLACE(?input1, "%", "%25"), "\\|", "%7C"))) AS ?hash)
  BIND (REPLACE(REPLACE(REPLACE(REPLACE(SUBSTR(?hash, 17, 1), "[048c]", "8"), "[159d]", "9"), "[26ae]", "a"), "[37bf]", "b")
        AS ?variant)
  BIND (IRI(CONCAT("urn:uuid:", SUBSTR(?hash, 1, 8), "-", SUBSTR(?hash, 9, 4), "-8", SUBSTR(?hash, 14, 3), "-", ?variant,
                   SUBSTR(?hash, 18, 3), "-", SUBSTR(?hash, 21, 12))) AS ?name)
  BIND (IF(?normalisable, STR(?name), "none, since the rule cannot read the base") AS ?expected)
  FILTER (!?normalisable || ?address != ?input1 || $this != ?name)
}
]

cascade:ServerShape checks each cascade:Server, and the subject of any cascade:selfAssertedBaseUrl, cascade:authorizationEndpoint, cascade:serverSoftwareName, cascade:serverSoftwareVersion, cascade:connectClientId.

PropertyValue typeHow manyWhen it is not met
cascade:selfAssertedBaseUrlxsd:stringat most 1 A server version has at most one self-asserted base URL, a string.
cascade:authorizationEndpointxsd:stringat most 1 A server version has at most one authorization endpoint, a string.
cascade:serverSoftwareNamexsd:string minLength 1at most 1 A server version has at most one software name, a non-empty string.
cascade:serverSoftwareVersionxsd:string minLength 1at most 1 A server version has at most one software version, a non-empty string.
cascade:connectClientIdxsd:string minLength 1at most 1 A server version has at most one client id, a non-empty string.
cascade:patientat most 0 A server's record names no patient: it is never the subject's.
Where it comes from and what uses it
Subclass of
prov:SoftwareAgent, prov:Entity
See also
https://hl7.org/fhir/R4/capabilitystatement.html
Queries
Rules