Jena DatatypeProperty和literal

时间:2018-02-07 21:33:51

标签: java jena

我需要创建一个DatatypeProperty,其中包含从我创建的类以及我从用户获得的范围文字。我怎么能这样做?

DatatypeProperty HasPhysicalData =m.createDatatypeProperty(SNS+"physicalObjectHasPhysicalProperty");

DatatypeProperty HasType = m.getDatatypeProperty(SNS+"physicalPropertyHasType");

HasType.addSubProperty(HasPhysicalData);

HasPhysicalData.addDomain(clsAttr);

1 个答案:

答案 0 :(得分:0)

  • 数据类型属性的范围是XML Schema URI

  • Jena在XSD vocabulary类中提供了这些URI作为资源。

  • 您需要将从用户获得的值映射到上述XSD资源之一。