clownface-shacl-path
Advanced tools
Comparing version 2.2.0 to 2.3.0
import type { NamedNode } from '@rdfjs/types'; | ||
import { SparqlTemplateResult } from '@tpluscode/rdf-string'; | ||
import { MultiPointer } from 'clownface'; | ||
import { ShaclPropertyPath } from './path.js'; | ||
/** | ||
* Creates a SPARQL template string which represents a SHACL path as Property Path | ||
* | ||
* @param path SHACL Property Path | ||
* @param pathOrNode SHACL Property Path | ||
*/ | ||
export declare function toSparql(path: MultiPointer | NamedNode): SparqlTemplateResult; | ||
export declare function toSparql(pathOrNode: MultiPointer | NamedNode | ShaclPropertyPath): SparqlTemplateResult; | ||
export declare namespace toSparql { | ||
@@ -11,0 +12,0 @@ var sequence: (path: MultiPointer) => SparqlTemplateResult[]; |
@@ -45,7 +45,10 @@ import { sparql } from '@tpluscode/rdf-string'; | ||
* | ||
* @param path SHACL Property Path | ||
* @param pathOrNode SHACL Property Path | ||
*/ | ||
export function toSparql(path) { | ||
export function toSparql(pathOrNode) { | ||
const visitor = new ToSparqlPropertyPath(); | ||
return visitor.visit(fromNode(path)); | ||
const path = 'termType' in pathOrNode || '_context' in pathOrNode | ||
? fromNode(pathOrNode) | ||
: pathOrNode; | ||
return visitor.visit(path); | ||
} | ||
@@ -52,0 +55,0 @@ /** |
{ | ||
"name": "clownface-shacl-path", | ||
"description": "Find nodes in graph by following SHACL Paths", | ||
"version": "2.2.0", | ||
"version": "2.3.0", | ||
"main": "index.js", | ||
@@ -6,0 +6,0 @@ "type": "module", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
38097
439