Wosh
Wosh

Reputation: 1625

RDF Turtle syntax - How to reduce code duplication?

I am having the following valid Turtle Syntax:

@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>.
@prefix sc: <http://education.data.gov.uk/def/school/School#>.
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>.
@prefix geo: <http://www.w3.org/2003/01/geo/wgs84_pos>.

<http://example.com/schools/#1000> a <http://education.data.gov.uk/def/school/School> . 
<http://example.com/schools/#1000> <http://education.data.gov.uk/def/school/establishmentName>    "Atherstone Early Years Centre". 
<http://example.com/schools/#1000> <http://education.data.gov.uk/def/school/establishmentNumber> "1000". 
<http://example.com/schools/#1000> <http://education.data.gov.uk/def/school/Address>  [<http://education.data.gov.uk/def/school/address1> "RATCLIFFE ROAD";     <http://education.data.gov.uk/def/school/postcode> "CV9 1LF"]. 
<http://example.com/schools/#1000> <http://education.data.gov.uk/def/school/establishmentType> "Nursery".
<http://example.com/schools/#1000> <http://education.data.gov.uk/def/school/districtAdministrative> "North Warwickshire".
<http://example.com/schools/#1000> <http://education.data.gov.uk/def/school/uniqueReferenceNumber> "2016".
<http://example.com/schools/#1000> geo:lat "52.5786677".
<http://example.com/schools/#1000> geo:long "-1.5420408".

I basically define a school object with id#1000 and after that I add properties to it. I was wondering whether I can get rid off the <http://example.com/schools/#1000> definition before every attribute and in some way to enclose the attributes with brackets or something else. Any ideas?

Upvotes: 2

Views: 298

Answers (1)

user205512
user205512

Reputation: 8898

Semi-colon:

<http://example.com/schools/#1000>
  a <http://education.data.gov.uk/def/school/School> ;
  <http://education.data.gov.uk/def/school/establishmentName>    "Atherstone Early Years Centre" ;
  ...
  <http://example.com/schools/#1000> geo:long "-1.5420408" .

Upvotes: 7

Related Questions