确保多个主题指向空白节点的相同列表 [英] Ensure that multiple subjects point to same list of blank nodes
问题描述
请考虑以下SomeClass
实例:
instances:some_thing1
a semapi:SomeClass ;
semapi:hasChainTo (
[ ... ] [ ... ] [ ... ]
) .
我需要每个 实例(some_thing2
,some_thing3
等),使其hasChainTo
属性点指向相同的空白节点列表(与里面只有一个副本).我需要维护空白节点语法的列表,因为链变得很深,并且此语法对于写出每个链(对于SomeClass2
,SomeClass3
等)来说非常流畅.
I need every instance (some_thing2
, some_thing3
, etc.) to have its hasChainTo
property point at the same list of blank nodes (as in there is only one copy of it). I need to maintain the list of blank nodes syntax because the chains get very deep and this syntax is very fluid for writing out each chain (for SomeClass2
, SomeClass3
, etc.).
如果仅从中创建基类和subClassOf,则hasChainTo
属性会继承,但不会继承其指向的对象.从直觉上讲这很有意义,但是我需要其他行为.
If I simply make a base class and subClassOf from it, the hasChainTo
property inherits but not the object it's pointing to. This intuitively makes sense but I need the other behavior.
这怎么完成?
推荐答案
如果要从图中的多个节点引用同一内容,则应给它提供URI.它不必是完整的http:
URI-您可以使用UUID:
If you want to refer to the same thing from multiple nodes in the graph, you should give it a URI. It doesn't have to be a full http:
URI - you could use a UUID:
instances:some_thing_1
semapi:hasChainTo <urn:uuid:12345>.
instances:some_thing_2
semapi:hasChainTo <urn:uuid:12345>.
instances:some_thing_3
semapi:hasChainTo <urn:uuid:12345>.
<urn:uuid:12345>
semapi:chain (
[ .. ] [ .. ] [ .. ]
).
不要将RDFS/OWL子类与面向对象语言中的状态和行为继承相混淆. RDFS中的类层次结构用于分类节点-即,将其分配给一个类,其中,类是一组资源.在Java之类的语言中,从继承中获得的代码重用没有直接的等效方法.
Don't confuse RDFS/OWL sub-classes with inheritance of state and behaviour in object-oriented languages. The class hierarchy in RDFS is for classifying nodes - i.e. assigning them to a class, where a class is some set of resources. There is no direct equivalent of the code-reuse you get from inheritance in languages like Java.
这篇关于确保多个主题指向空白节点的相同列表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!