Rdf 如何使用SHACL验证json ld 1.1数据图?

Rdf 如何使用SHACL验证json ld 1.1数据图?,rdf,json-ld,shacl,Rdf,Json Ld,Shacl,数据图:(json ld) .ttl格式的数据图: @prefix activity: <https://raw.githubusercontent.com/ReproNim/schema-standardization/master/activities/> . @prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> . @prefix rdfs: <http://www.w3.org/2000/01/

数据图:(json ld)

.ttl格式的数据图:

@prefix activity: <https://raw.githubusercontent.com/ReproNim/schema-standardization/master/activities/> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix schema: <http://schema.org/> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix skos: <http://www.w3.org/2004/02/skos/core#> .
@prefix reproterms: <https://raw.githubusercontent.com/ReproNim/schema-standardization/master/terms/> .
@prefix activity: <https://raw.githubusercontent.com/ReproNim/schema-standardization/master/activities/> .
@prefix reproschema: <https://raw.githubusercontent.com/ReproNim/schema-standardization/master/schemas/> .

activity:PHQ-9/phq9_schema
    a reproschema:Activity ;
    skos:prefLabel "PHQ-9 Assessment" .

@前缀活动:。
@前缀rdf:。
@前缀rdfs:。
@前缀架构:。
@前缀xsd:。
@前缀skos:。
@前缀和术语:。
@前缀活动:。
@前缀架构:。
活动:PHQ-9/phq9_模式
a:活动;
skos:预先标注“PHQ-9评估”。
图形形状:

@prefix dash: <http://datashapes.org/dash#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix schema: <http://schema.org/> .
@prefix sh: <http://www.w3.org/ns/shacl#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix reproterms: <https://raw.githubusercontent.com/ReproNim/schema-standardization/master/terms/> .
@prefix skos: <http://www.w3.org/2004/02/skos/core#> .
@prefix reproschema: <https://raw.githubusercontent.com/ReproNim/schema-standardization/master/schemas/> .

reproschema:ActivityShape
    a sh:NodeShape ;
    sh:targetClass reproschema:Activity;

    sh:property [
        sh:path skos:prefLabel ;
        sh:datatype rdf:langString ;
        sh:minCount 1 ;
        sh:maxCount 1 ;
    ] .
@前缀破折号:。
@前缀rdf:。
@前缀rdfs:。
@前缀架构:。
@前缀sh:。
@前缀xsd:。
@前缀和术语:。
@前缀skos:。
@前缀架构:。
reproschema:ActivityShape
阿什:NodeShape;
sh:targetClass模式:活动;
sh:物业[
sh:path skos:prefLabel;
sh:数据类型rdf:langString;
sh:minCount 1;
sh:最大计数1;
] .

如果上下文包含@version:1.1,则它似乎不起作用;给出了一个错误。如何对JSON-LD1.1中表示的图形进行验证?我还添加了海龟格式的数据图。

约束sh:datatype rdf:langString要求属性的所有值都有一个语言标记。例如,skos:prefLabel“PHQ-9评估”@en就可以工作。或者将约束更改为sh:datatypexsd:string。

要响应,需要同时了解JSON-LD1.1和SHACL。我尝试使用Jena加载您的文件,但看不到任何三元组,因此可能Jena不支持这种特定语法,或者JSON-LD有问题。你能用一种更常见的格式(如Turtle)重新保存数据图吗?@HolgerKnublauch以Turtle格式添加了数据图。当我使用海龟形态时,它就起作用了。那么json ld格式的数据呢?在这种情况下,我是否需要从上下文中删除“@version”:1.1?
@prefix dash: <http://datashapes.org/dash#> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix schema: <http://schema.org/> .
@prefix sh: <http://www.w3.org/ns/shacl#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix reproterms: <https://raw.githubusercontent.com/ReproNim/schema-standardization/master/terms/> .
@prefix skos: <http://www.w3.org/2004/02/skos/core#> .
@prefix reproschema: <https://raw.githubusercontent.com/ReproNim/schema-standardization/master/schemas/> .

reproschema:ActivityShape
    a sh:NodeShape ;
    sh:targetClass reproschema:Activity;

    sh:property [
        sh:path skos:prefLabel ;
        sh:datatype rdf:langString ;
        sh:minCount 1 ;
        sh:maxCount 1 ;
    ] .