# Rules for structuring isolate resources and filling in their properties @prefix vg: . # rule1: Ensures a virus isolate resource exists for each sequence record. # The virus isolate is created if it does not exist. # The virus isolate is linked to linked to all its sequence record by the # property vg:hasSequenceRecord # # To determine the isolate URI, the isolate name is normalized, which means # that it is made lowercase, and all whitespace is removed. Any special # characters other than '/' are also removed. Hence, isolate names containing # "Hong Kong" "HongKong", Hongkong" and "Hong-Kong" will give same id. The # idea is to overcome ids with alternative spellings. [rule1: (?rec rdf:type vg:SequenceRecord) (?rec vg:isolate ?isolateId) normalizeIsolate(?isolateId, ?nIsolateId) uriConcat('urn:abk:isolate:', ?nIsolateId, ?isolateUri) -> (?isolateUri rdf:type vg:VirusIsolate) (?isolateUri vg:hasSequenceRecord ?rec) ] # rule2: Copy properties for isolate name, subtype, year, country and host # from sequence record to virus isolate. This may copy multiple values from # different sequence records to the same virus isolate. The idea is that # these multiple values will be detected later, as the properties are # functional. [rule2: (?isolateUri vg:hasSequenceRecord ?rec) (?rec ?prop ?value) oneOf(?prop, vg:isolate, vg:virusSubtype, vg:year, vg:country, vg:hostOrganism) -> (?isolateUri ?prop ?value) ]