-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathURIs.py
155 lines (127 loc) · 4.18 KB
/
URIs.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
# All the resources (including the properties) are defined using
# the [class `URIRef`](https://rdflib.readthedocs.io/en/stable/apidocs/rdflib.html#rdflib.term.URIRef).
# The constructor of this class takes in input a string representing the IRI (or URL) of the resource in consideration.
#
# Using these classes it is possible to create all the Python objects necessary
# to create statements describing all the data to be pushed into an RDF graph.
from rdflib import Namespace
from rdflib import URIRef
################################################################################
#
# Define namespace used.
#
################################################################################
RES = Namespace("https://allorapy.github.io/res/")
FABIO = Namespace("http://purl.org/spar/fabio/")
PRISM = Namespace("http://prismstandard.org/namespaces/basic/2.0/")
CITO = Namespace("http://purl.org/spar/cito/")
DATACITE = Namespace("http://purl.org/spar/datacite/")
DCTERMS = Namespace("http://purl.org/dc/terms/")
FOAF = Namespace("http://xmlns.com/foaf/0.1/")
SCHEMA = Namespace("https://schema.org/")
WD = Namespace("http://wikidata.org/entity/")
# my_graph.bind('fabio', FABIO)
# my_graph.bind('prism', PRISM)
# my_graph.bind('wd', WD)
# my_graph.bind('', RES)
################################################################################
#
# Main Class of resources.
#
################################################################################
IdentifiableEntity = URIRef("https://www.wikidata.org/wiki/Q35120")
################################################################################
#
# Inherited Classes.
#
################################################################################
#
# Person.
#
Person = URIRef("http://xmlns.com/foaf/0.1/Person")
#
# Publication.
#
Publication = URIRef("https://www.wikidata.org/wiki/Q732577")
#
# Publication sub-classes.
#
JournalArticle = URIRef("http://purl.org/spar/fabio/JournalArticle")
BookChapter = URIRef("http://purl.org/spar/fabio/BookChapter")
ProceedingsPaper = URIRef("http://purl.org/spar/fabio/ProceedingsPaper")
#
# Venue.
#
Venue = URIRef("https://www.wikidata.org/wiki/Q2085381")
#
# Venue sub-classes.
#
Journal = URIRef("http://purl.org/spar/fabio/Journal")
Book = URIRef("http://purl.org/spar/fabio/Book")
Proceedings = URIRef("http://purl.org/spar/fabio/ConferenceProceedings")
#
# Organization.
#
Organization = URIRef("https://schema.org/Organization")
################################################################################
#
# Properties.
#
################################################################################
#
# IdentifiableEntity properties.
#
id = URIRef("http://purl.org/dc/terms/identifier")
#
# Person properties.
#
givenName = URIRef("http://xmlns.com/foaf/0.1/givenName")
familyName = URIRef("http://xmlns.com/foaf/0.1/familyName")
#
# Publication properties.
#
title = URIRef("http://purl.org/dc/terms/title")
publicationYear = URIRef("http://purl.org/spar/fabio/hasPublicationYear")
#
# JournalArticle sub-class properties.
#
issue = URIRef("http://prismstandard.org/namespaces/basic/2.0/issueIdentifier")
volume = URIRef("http://purl.org/spar/fabio/JournalVolume")
#
# BookChapter sub-class properties.
#
chapterNumber = URIRef("http://purl.org/spar/fabio/hasSequenceIdentifier")
#
# ProceedingsPaper sub-class properties.
#
# null.
#
# Venue properties.
#
# title = URIRef("http://purl.org/dc/terms/title") // Already definied in Publication.
#
# Journal sub-class properties.
#
# null.
#
# Book sub-class properties.
#
# null.
#
# Proceedings sub-class properties.
#
event = URIRef("https://schema.org/Event")
#
# Organization properties.
#
name = URIRef("https://schema.org/name")
################################################################################
#
# Relations.
#
################################################################################
# Classes relations.
hasAuthor = URIRef("http://purl.org/dc/terms/creator")
hasCites = URIRef("http://purl.org/spar/cito/cites") #TODO: correct hasCites
hasPublicationVenue = URIRef("https://schema.org/isPartOf")
hasPublisher = URIRef("http://purl.org/dc/terms/publisher")