SPARQL有助于构建修改查询

时间:2018-04-04 08:58:17

标签: sparql rdf

我必须在现有报告中添加一些新字段。我们的系统已经有很多类型为AccountTeamBodReport,CoordinatorBodReport的报告。另外,我想为新字段设置默认值。

PREFIX  :     <http://example.com/knowledge-black-belt#>
PREFIX  xsd:  <http://www.w3.org/2001/XMLSchema#>
PREFIX  rdf:  <http://www.w3.org/1999/02/22-rdf-syntax-ns#>

INSERT { ?s  :hasResult "" ; //(new fields)
        :hasResultPriority "MEDIUM";
        :hasLowMarginComments "";
        :hasLowMarginCommentsPriority "MEDIUM";

}
WHERE
    { ?s rdf:type    ?type ;

FILTER ( ?type IN (:AccountTeamBodReport, :CoordinatorBodReport) )
}

它不起作用。有任何错误。我做错了什么?我使用fuseki服务器并检查我的所有查询。 Fuseki日志只有成功的响应。当我想查看我使用的具体报告时:

PREFIX  :     <http://dataart.com/knowledge-black-belt#>
PREFIX  xsd:  <http://www.w3.org/2001/XMLSchema#>
PREFIX  rdf:  <http://www.w3.org/1999/02/22-rdf-syntax-ns#>

SELECT *
WHERE
 { ?s  :hasId                ?name ;
    rdf:type              ?type ;
    :hasCreationTime      ?created ;
    :hasReportMonth       ?reportMonth ;
    :hasAchievements      ?achievements ;
    :hasAchievementsPriority  ?achievementsPriority ;
    :hasRisksIssues       ?risksIssues ;
    :hasRisksIssuesPriority  ?risksIssuesPriority ;
    :hasOther             ?other ;
    :hasOtherPriority     ?otherPriority ;
    :hasPerformance       ?performance ;
    :hasCustomerRelationship  ?customerRelationship ;
    :hasTeamMorale        ?teamMorale ;
    :hasNoNews            ?noNews ;
    :hasResult            ?result ; 
    :hasResultPriority    ?resultPriority;
    :hasLowMarginComments ?lowMarginComments;
    :hasLowMarginCommentsPriority ?lowMarginCommentsPriority;
    :hasClient ?client
OPTIONAL
  { ?s  :hasIndicatorDescription  ?indicatorDescription}
 ?s  rdf:type    ?type ;
    :hasClient :clientSomeId


FILTER ( ?type IN (:AccountTeamBodReport, :CoordinatorBodReport) )
}

插入查询后有任何更改。

0 个答案:

没有答案