Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 37 additions & 6 deletions examples/tutorial/tutorial01/data.ttl
Original file line number Diff line number Diff line change
@@ -1,7 +1,38 @@
@prefix personinfo: <https://w3id.org/linkml/examples/personinfo> .

[] a personinfo:Person ;
personinfo:age "32" ;
personinfo:full_name "Clark Kent" ;
personinfo:id "ORCID:1234" ;
personinfo:phone "555-555-5555" .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix wgs: <https://www.w3.org/2003/01/geo/wgs84_pos#> .
@prefix geo: <http://www.opengis.net/ont/geosparql#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix brick: <https://brickschema.org/schema/Brick#> .
@prefix skos: <http://www.w3.org/2004/02/skos/core#> .
@prefix xml: <http://www.w3.org/XML/1998/namespace> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
@prefix qb: <http://purl.org/linked-data/cube#> .
@prefix dc: <http://purl.org/dc/elements/1.1/> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix doap: <http://usefulinc.com/ns/doap#> .
@prefix prof: <http://www.w3.org/ns/dx/prof/> .
@prefix dcmitype: <http://purl.org/dc/dcmitype/> .
@prefix odrl: <http://www.w3.org/ns/odrl/2/> .
@prefix time: <http://www.w3.org/2006/time#> .
@prefix vann: <http://purl.org/vocab/vann/> .
@prefix sh: <http://www.w3.org/ns/shacl#> .
@prefix csvw: <http://www.w3.org/ns/csvw#> .
@prefix shex: <http://www.w3.org/ns/shex#> .
@prefix dcat: <http://www.w3.org/ns/dcat#> .
@prefix sosa: <http://www.w3.org/ns/sosa/> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix prov: <http://www.w3.org/ns/prov#> .
@prefix org: <http://www.w3.org/ns/org#> .
@prefix ssn: <http://www.w3.org/ns/ssn/> .
@prefix dcterms: <http://purl.org/dc/terms/> .
@prefix dcam: <http://purl.org/dc/dcam/> .
@prefix void: <http://rdfs.org/ns/void#> .
@prefix linkml: <https://w3id.org/linkml/> .
@prefix schema: <https://schema.org/> .
@prefix schema1: <http://schema.org/> .
_:c14n0 a personinfo:Person ;
personinfo:age "32" ;
personinfo:full_name "Clark Kent" ;
personinfo:id "ORCID:1234" ;
personinfo:phone "555-555-5555" .
60 changes: 45 additions & 15 deletions examples/tutorial/tutorial04/data-semantic.ttl
Original file line number Diff line number Diff line change
@@ -1,17 +1,47 @@
@prefix ORCID: <https://orcid.org/> .
@prefix oboInOwl: <http://www.geneontology.org/formats/oboInOwl#> .
@prefix personinfo: <https://w3id.org/linkml/examples/personinfo/> .
@prefix schema1: <http://schema.org/> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix wgs: <https://www.w3.org/2003/01/geo/wgs84_pos#> .
@prefix faldo: <http://biohackathon.org/resource/faldo#> .
@prefix brick: <https://brickschema.org/schema/Brick#> .
@prefix geo: <http://www.opengis.net/ont/geosparql#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix skos: <http://www.w3.org/2004/02/skos/core#> .
@prefix xml: <http://www.w3.org/XML/1998/namespace> .
@prefix qb: <http://purl.org/linked-data/cube#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .

ORCID:1234 a schema1:Person ;
schema1:name "Clark Kent" ;
schema1:telephone "555-555-5555" ;
personinfo:age 33 .

ORCID:4567 a schema1:Person ;
schema1:name "Lois Lane" ;
personinfo:age 34 .

[] a personinfo:Container ;
personinfo:persons ORCID:1234,
ORCID:4567 .
@prefix dc: <http://purl.org/dc/elements/1.1/> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix doap: <http://usefulinc.com/ns/doap#> .
@prefix prof: <http://www.w3.org/ns/dx/prof/> .
@prefix dcmitype: <http://purl.org/dc/dcmitype/> .
@prefix odrl: <http://www.w3.org/ns/odrl/2/> .
@prefix time: <http://www.w3.org/2006/time#> .
@prefix sh: <http://www.w3.org/ns/shacl#> .
@prefix vann: <http://purl.org/vocab/vann/> .
@prefix shex: <http://www.w3.org/ns/shex#> .
@prefix sosa: <http://www.w3.org/ns/sosa/> .
@prefix dcat: <http://www.w3.org/ns/dcat#> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix csvw: <http://www.w3.org/ns/csvw#> .
@prefix prov: <http://www.w3.org/ns/prov#> .
@prefix dcterms: <http://purl.org/dc/terms/> .
@prefix ssn: <http://www.w3.org/ns/ssn/> .
@prefix org: <http://www.w3.org/ns/org#> .
@prefix linkml: <https://w3id.org/linkml/> .
@prefix oa: <http://www.w3.org/ns/oa#> .
@prefix dcam: <http://purl.org/dc/dcam/> .
@prefix void: <http://rdfs.org/ns/void#> .
@prefix idot: <http://identifiers.org/> .
@prefix schema: <https://schema.org/> .
@prefix schema1: <http://schema.org/> .
@prefix ORCID: <https://orcid.org/> .
ORCID:1234 schema1:name "Clark Kent" ;
schema1:telephone "555-555-5555" ;
a schema1:Person ;
personinfo:age 33 .
ORCID:4567 schema1:name "Lois Lane" ;
a schema1:Person ;
personinfo:age 34 .
_:c14n0 a personinfo:Container ;
personinfo:persons ORCID:1234 , ORCID:4567 .
55 changes: 43 additions & 12 deletions examples/tutorial/tutorial04/data.ttl
Original file line number Diff line number Diff line change
@@ -1,16 +1,47 @@
@prefix ORCID: <https://orcid.org/> .
@prefix oboInOwl: <http://www.geneontology.org/formats/oboInOwl#> .
@prefix personinfo: <https://w3id.org/linkml/examples/personinfo/> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix wgs: <https://www.w3.org/2003/01/geo/wgs84_pos#> .
@prefix faldo: <http://biohackathon.org/resource/faldo#> .
@prefix brick: <https://brickschema.org/schema/Brick#> .
@prefix geo: <http://www.opengis.net/ont/geosparql#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix skos: <http://www.w3.org/2004/02/skos/core#> .
@prefix xml: <http://www.w3.org/XML/1998/namespace> .
@prefix qb: <http://purl.org/linked-data/cube#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .

@prefix dc: <http://purl.org/dc/elements/1.1/> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix doap: <http://usefulinc.com/ns/doap#> .
@prefix prof: <http://www.w3.org/ns/dx/prof/> .
@prefix dcmitype: <http://purl.org/dc/dcmitype/> .
@prefix odrl: <http://www.w3.org/ns/odrl/2/> .
@prefix time: <http://www.w3.org/2006/time#> .
@prefix sh: <http://www.w3.org/ns/shacl#> .
@prefix vann: <http://purl.org/vocab/vann/> .
@prefix shex: <http://www.w3.org/ns/shex#> .
@prefix sosa: <http://www.w3.org/ns/sosa/> .
@prefix dcat: <http://www.w3.org/ns/dcat#> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix csvw: <http://www.w3.org/ns/csvw#> .
@prefix prov: <http://www.w3.org/ns/prov#> .
@prefix dcterms: <http://purl.org/dc/terms/> .
@prefix ssn: <http://www.w3.org/ns/ssn/> .
@prefix org: <http://www.w3.org/ns/org#> .
@prefix linkml: <https://w3id.org/linkml/> .
@prefix oa: <http://www.w3.org/ns/oa#> .
@prefix dcam: <http://purl.org/dc/dcam/> .
@prefix void: <http://rdfs.org/ns/void#> .
@prefix idot: <http://identifiers.org/> .
@prefix schema: <https://schema.org/> .
@prefix schema1: <http://schema.org/> .
@prefix ORCID: <https://orcid.org/> .
ORCID:1234 a personinfo:Person ;
personinfo:age 33 ;
personinfo:full_name "Clark Kent" ;
personinfo:phone "555-555-5555" .

personinfo:age 33 ;
personinfo:full_name "Clark Kent" ;
personinfo:phone "555-555-5555" .
ORCID:4567 a personinfo:Person ;
personinfo:age 34 ;
personinfo:full_name "Lois Lane" .

[] a personinfo:Container ;
personinfo:persons ORCID:1234,
ORCID:4567 .
personinfo:age 34 ;
personinfo:full_name "Lois Lane" .
_:c14n0 a personinfo:Container ;
personinfo:persons ORCID:1234 , ORCID:4567 .
112 changes: 77 additions & 35 deletions examples/tutorial/tutorial04/personinfo-semantic.shacl.ttl
Original file line number Diff line number Diff line change
@@ -1,39 +1,81 @@
@prefix personinfo: <https://w3id.org/linkml/examples/personinfo/> .
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix schema1: <http://schema.org/> .
@prefix sh: <http://www.w3.org/ns/shacl#> .
@prefix wgs: <https://www.w3.org/2003/01/geo/wgs84_pos#> .
@prefix brick: <https://brickschema.org/schema/Brick#> .
@prefix geo: <http://www.opengis.net/ont/geosparql#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix skos: <http://www.w3.org/2004/02/skos/core#> .
@prefix xml: <http://www.w3.org/XML/1998/namespace> .
@prefix qb: <http://purl.org/linked-data/cube#> .
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .

personinfo:Container a sh:NodeShape ;
sh:closed true ;
sh:ignoredProperties ( rdf:type ) ;
sh:property [ sh:class schema1:Person ;
sh:nodeKind sh:IRI ;
sh:order 0 ;
sh:path personinfo:persons ] ;
sh:targetClass personinfo:Container .

@prefix dc: <http://purl.org/dc/elements/1.1/> .
@prefix owl: <http://www.w3.org/2002/07/owl#> .
@prefix doap: <http://usefulinc.com/ns/doap#> .
@prefix prof: <http://www.w3.org/ns/dx/prof/> .
@prefix dcmitype: <http://purl.org/dc/dcmitype/> .
@prefix odrl: <http://www.w3.org/ns/odrl/2/> .
@prefix time: <http://www.w3.org/2006/time#> .
@prefix vann: <http://purl.org/vocab/vann/> .
@prefix sh: <http://www.w3.org/ns/shacl#> .
@prefix dcat: <http://www.w3.org/ns/dcat#> .
@prefix csvw: <http://www.w3.org/ns/csvw#> .
@prefix sosa: <http://www.w3.org/ns/sosa/> .
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix prov: <http://www.w3.org/ns/prov#> .
@prefix org: <http://www.w3.org/ns/org#> .
@prefix ssn: <http://www.w3.org/ns/ssn/> .
@prefix dcterms: <http://purl.org/dc/terms/> .
@prefix linkml: <https://w3id.org/linkml/> .
@prefix void: <http://rdfs.org/ns/void#> .
@prefix dcam: <http://purl.org/dc/dcam/> .
@prefix schema: <https://schema.org/> .
@prefix schema1: <http://schema.org/> .
@prefix ORCID: <https://orcid.org/> .
schema1:Person a sh:NodeShape ;
sh:closed true ;
sh:ignoredProperties ( rdf:type ) ;
sh:property [ sh:maxCount 1 ;
sh:maxInclusive 200 ;
sh:minInclusive 0 ;
sh:order 4 ;
sh:path personinfo:age ],
[ sh:description "name of the person" ;
sh:maxCount 1 ;
sh:minCount 1 ;
sh:order 1 ;
sh:path schema1:name ],
[ sh:maxCount 1 ;
sh:order 0 ;
sh:path personinfo:id ],
[ sh:description "other names for the person" ;
sh:order 2 ;
sh:path personinfo:aliases ],
[ sh:maxCount 1 ;
sh:order 3 ;
sh:path schema1:telephone ;
sh:pattern "^[\\d\\(\\)\\-]+$" ] ;
sh:targetClass schema1:Person .
sh:closed true ;
sh:ignoredProperties _:c14n7 ;
sh:property _:c14n0 , _:c14n2 , _:c14n3 , _:c14n4 , _:c14n6 ;
sh:targetClass schema1:Person .
personinfo:Container a sh:NodeShape ;
sh:closed true ;
sh:ignoredProperties _:c14n1 ;
sh:property _:c14n5 ;
sh:targetClass personinfo:Container .
_:c14n0 sh:datatype xsd:string ;
sh:description "name of the person" ;
sh:maxCount 1 ;
sh:minCount 1 ;
sh:nodeKind sh:Literal ;
sh:order 1 ;
sh:path schema1:name .
_:c14n1 rdf:first rdf:type ;
rdf:rest rdf:nil .
_:c14n2 sh:datatype xsd:string ;
sh:maxCount 1 ;
sh:nodeKind sh:Literal ;
sh:order 0 ;
sh:path personinfo:id .
_:c14n3 sh:datatype xsd:integer ;
sh:maxCount 1 ;
sh:maxInclusive 200 ;
sh:minInclusive 0 ;
sh:nodeKind sh:Literal ;
sh:order 4 ;
sh:path personinfo:age .
_:c14n4 sh:datatype xsd:string ;
sh:maxCount 1 ;
sh:nodeKind sh:Literal ;
sh:order 3 ;
sh:path schema1:telephone ;
sh:pattern "^[\\d\\(\\)\\-]+$" .
_:c14n5 sh:class schema1:Person ;
sh:nodeKind sh:IRI ;
sh:order 0 ;
sh:path personinfo:persons .
_:c14n6 sh:datatype xsd:string ;
sh:description "other names for the person" ;
sh:nodeKind sh:Literal ;
sh:order 2 ;
sh:path personinfo:aliases .
_:c14n7 rdf:first rdf:type ;
rdf:rest rdf:nil .
10 changes: 8 additions & 2 deletions packages/linkml/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,10 @@ dependencies = [ # Specifier syntax: https://peps.python.org/pep-0631/
"openpyxl",
"parse",
"prefixcommons >= 0.1.7",
"prefixmaps >= 0.2.2",
# TODO(prefixmaps-0.2.8): Replace git pin with "prefixmaps >= 0.2.8" once released,
# then remove [tool.hatch.metadata] allow-direct-references and regenerate uv.lock.
# Tracked in: https://github.com/linkml/prefixmaps/issues/82
"prefixmaps @ git+https://github.com/linkml/prefixmaps@75435150a1b31760b9780af2b64a265943a9b263",
"pydantic >= 2.0.0, < 3.0.0",
"pyjsg >= 0.11.6",
"pyshex >= 0.7.20",
Expand Down Expand Up @@ -78,7 +81,6 @@ tests = [
{ include-group = "lint" },
{ include-group = "typing" },
{ include-group = "shacl" },
"morph-kgc >= 2.9.0; python_version >= '3.10'"
]
dev = [
{include-group = "tests" },
Expand Down Expand Up @@ -196,6 +198,10 @@ vcs = "git"
style = "pep440"
fallback-version = "0.0.0"

[tool.hatch.metadata]
# TODO(prefixmaps-0.2.8): Remove this section once the git pin is replaced with >= 0.2.8
allow-direct-references = true

[tool.hatch.version]
source = "uv-dynamic-versioning"

Expand Down
4 changes: 2 additions & 2 deletions packages/linkml/src/linkml/generators/golanggen/template.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ class GolangTemplateModel(TemplateModel):
trim_blocks=True,
lstrip_blocks=True,
)
_environment.filters["go_comment"] = lambda text, indent="": (
"\n".join(f"{indent}// {line}" if line.strip() else f"{indent}//" for line in text.splitlines())
_environment.filters["go_comment"] = lambda text, indent="": "\n".join(
f"{indent}// {line}" if line.strip() else f"{indent}//" for line in text.splitlines()
)

meta_exclude: ClassVar[list[str]] = None
Expand Down
Loading
Loading