Skip to content

Commit

Permalink
Updated the ldh:ChildrenViewContructor as well as the CLI script to…
Browse files Browse the repository at this point in the history
… match the new `ldh:View` structure (embedded via `ldh:Object`)
  • Loading branch information
namedgraph committed Dec 18, 2024
1 parent c14c149 commit 195dd34
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 22 deletions.
20 changes: 0 additions & 20 deletions scripts/add-view-block.sh → scripts/add-view.sh
100755 → 100644
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,6 @@ do
shift # past argument
shift # past value
;;
--proxy)
proxy="$2"
shift # past argument
shift # past value
;;
-b|--base)
base="$2"
shift # past argument
Expand Down Expand Up @@ -96,20 +91,6 @@ if [ -z "$query" ] ; then
exit 1
fi

target="$1"

ntriples=$(./get.sh \
-f "$cert_pem_file" \
-p "$cert_password" \
--proxy "$proxy" \
--accept 'application/n-triples' \
"$target")

# extract the numbers from the sequence properties
sequence_number=$(echo "$ntriples" | grep "<${target}> <http://www.w3.org/1999/02/22-rdf-syntax-ns#_" | cut -d " " -f 2 | cut -d'#' -f 2 | cut -d '_' -f 2 | cut -d '>' -f 1 | sort -nr | head -n1)
sequence_number=$((sequence_number + 1)) # increase the counter
sequence_property="http://www.w3.org/1999/02/22-rdf-syntax-ns#_${sequence_number}"

args+=("-f")
args+=("$cert_pem_file")
args+=("-p")
Expand All @@ -127,7 +108,6 @@ fi
turtle+="@prefix ldh: <https://w3id.org/atomgraph/linkeddatahub#> .\n"
turtle+="@prefix dct: <http://purl.org/dc/terms/> .\n"
turtle+="@prefix spin: <http://spinrdf.org/spin#> .\n"
turtle+="<${target}> <${sequence_property}> ${subject} .\n"
turtle+="${subject} a ldh:View .\n"
turtle+="${subject} spin:query <${query}> .\n"

Expand Down
7 changes: 5 additions & 2 deletions src/main/resources/com/atomgraph/linkeddatahub/ldh.ttl
Original file line number Diff line number Diff line change
Expand Up @@ -574,8 +574,11 @@ dh:Item spin:constructor :TitleConstructor, :DescriptionConstructor, :PrimaryTop
PREFIX spin: <http://spinrdf.org/spin#>
CONSTRUCT {
$this rdf:_1 [ a ldh:View ;
spin:query ldh:SelectChildren
$this rdf:_1 [ a ldh:Object ;
rdf:value [
a ldh:View ;
spin:query ldh:SelectChildren
]
] .
}
WHERE {}""" ;
Expand Down

0 comments on commit 195dd34

Please sign in to comment.