Wandertext-server is the abstraction and reimplementation of the stalled nywalker-server project that fueled the old, NYU-hosted NYWalker project. It provides the backend for Wandertext, the reimplementation of NYWalker.
Wandertext-server exposes an Apollo GraphQL API that communicates with a Postgres database server via Sequelize.
The schema is straightforward and described both in ./src/models
and
.src/graphql/schema.js
. There are five models:
contributor
, which refers to a person creating or editing data in Wandertext. As such, they have many of the other four models.text
, which is the container for single datasets in Wandertext. In NYWalker, this model was called aBook
, but Wandertext lets us build different datasets. It has manycontributor
and manyentries
.place
, which refers to a geographical place. Each place can have manycontributors
andentries
.entry
, which is the atomic driver of the data captured in Wandertext. An entry belongs to aplace
and atext
, but can have manycontributors
. In NYWalker, these were calledInstances
.flag
, which is a meta object. Filled out by acontributor
(to which it belongs), a flag can be attached to atext
,place
, orentry
to alert to a problem with that other entity. As such, every model can definitionally have many flags, except the flag itself.
-
firstName
(string): The first part of the user’s name, which gets bumped to after the comma when sorting by “last name.” Hence, in a name like “Moacir P. de Sá Pereira,”firstName
would be"Moacir P. de"
. For a name like “Son Heung-Min,” it would benull
. -
lastName
(string): The second part of the user’s name, or the part that leads when sorting names alphabetically. From the examples above, we get values of"Sá Pereira"
and"Son Heung-Min"
, meaning that in a bibliography, the names would appear as:- Sá Pereira, Moacir P. de
- Son Heung-Min
-
enabled
(boolean): Whether a user can log in. Default:false
. -
superUser
(boolean): Whether a user can create texts in addition to places and entries. Default:false
. -
admin
(boolean): Whether a user can create new users. God mode. Default:false
. -
createdAt
(date): The creation date for the user. -
modifiedAt
(date): The modification date for the user. -
nywalkerProperties
(object): A representation of the user from NYWalker, should they have existed then. This will include, for example,id
,name
,email
,username
,admin
,added_on
,modified_on
,firstname
,lastname
, andenabled
.
-
name
(string): An identifier of the text in question. -
popupTemplate
(string): An HTML/handlebars template that determines how popups appear in Leaflet for entries associated with this text. -
markdownName
(string): A Markdown rendering of the name. For example, for aname
of"Bāburnāma"
, themarkdownName
can be"_Bāburnāma_"
, so that the name can be rendered in italics. -
markdownBlurb
(string): A blurb describing the text, written in Markdown. -
url
(string): A url associated with the text. -
imgSrc
(string): A url pointing to an image associated with the text. This can be the cover of a book, say. -
imgCredit
(string): A string describing how the image should be credited. -
imgHref
(string): A link that resolves when the user clicks on the image. -
entryProperties
(array): An array of property objects. A property object defines a property that entries belonging to this text are expected to have. For example, if the text is a book, every entry may be expected to have apage
property. That is defined here. If a text is a set of interviews, than every entry (interview) can be expected to have aninterviewee
property. Furthermore, the order of property objects determines the order in which the input fields are presented in data entry. Each property object can expect to have the following properties:name
(string): The name of the property, such as"page"
or"interviewee"
type
(string): What JavaScript type to expect. One of"string"
,"number"
, or"boolean"
.inputLabel
(string): The label corresponding to the input field for adding this property, such as"Page Number"
or"Interviewee Code"
.helpText
(string): The text underneath the input field that appears as help text.readOnly
(boolean): Whether this field can be changed or not. Useful when importing previously created data.
-
entrySort
(array): An array of property objects’.name
properties, defining the order in which entries are sorted by default. For a value of["page", "sequence"]
, for example, the entries would first be sorted by theirpage
property and then by theirsequence
property. -
createdOn
(date): The creation date for the text. -
modifiedOn
(date): The modification date for the text. -
nywalkerProperties
(object): A list of old properties from NYWalker. This could includeid
,slug
,author
,title
,isbn
,year
,url
,cover
,added_on
, andmodified_on
. -
users
: This represents the text’shasMany
relations.
-
type
(string):"Feature"
-
bbox
(array): An array representing the bounding box of the place. As the GeoJSON spec describes the format: “The value of the bbox member MUST be an array of length 2*n where n is the number of dimensions represented in the contained geometries, with all axes of the most southwesterly point followed by all axes of the more northeasterly point. The axes order of a bbox follows the axes order of geometries.” -
geometry
(object): An object with two properties.type
defaults to"Point"
andcoordinates
is an array of the format[<longitude>, <latitude>]
. -
properties
(object): A places properties are all nested in here, in following the GeoJSON spec. As such:name
(string): A name for the placeslug
(string): A (hopefully unique), url-safe version of the name.confidence
(number): A number between 0 and 3 indicating a subjective sense of confidence that this is an appropriate representation of the place in question.source
(string): The source for the coordinates. Typical responses are a Wikipedia link, Geonames, or Google Maps.geonameId
(number): If the place is harvested from Geonames, this is its id.note
(string): A note about the place, if needed.createdOn
(date): The creation date for the place.modifiedOn
(date): The modification date for the place.nywalkerProperties
(object): A list of old properties from NYWalker. This could includeid
,slug
,name
,added_on
,lat
,lon
,confidence
(as string),source
,geonameid
(as string),what3word
,bounding_box_string
,user_id
,flagged
,note
, andgeom
.
-
users
: This represents the place’shasMany
relations.
-
attestedName
(string): The string by which the entry’s place is referred to, such as"NYC"
for the place"New York City"
. -
note
(string): A note about the entry. -
createdOn
(date): The creation date for the entry. -
modifiedOn
(date): The modification date for the entry. -
nywalkerProperties
(object): A list of old properties from NYWalker. This could includeid
,page
,sequence
,text
,added_on
,modified_on
,place_id
,user_id
,book_id
,flagged
,note
, andspecial
. -
text
andplace
: These represent the entry’sbelongsTo
relations. -
users
: This represents the entry’shasMany
relations.
-
comment
(string): The text of the flag. -
createdOn
(date): The creation date for the flag. -
modifiedOn
(date): The modification date for the flag. -
nywalkerProperties
(object): A list of old properties from NYWalker. This could includeid
,comment
,object_type
,object_id
,added_on
, anduser_id
. -
user
,entry
,text
andplace
: These represent the flag’sbelongsTo
relations.
This repository differs from the earlier version in two, fundamental ways, both of which make the project more viable as a contributor to human knowledge.
First, the database’s document structure abstracts the old relational database
data structure of NYWalker. NYWalker had, effectively, three models: Book
,
Place
, and Instance
. Instance
s belonged to one Book
and to one
Place
. Because of that, the data structure of the Instance
was
predictable. There would be, for example, an integer captured that was the
page number for the Instance
. Similarly, Book
, the container object, also
had predictable properties, like an author or an ISBN number. Now, instead of
Book
, Instance
s (called Entry
s belong to an abstract Text
document. Furthermore, the
data structure of an Text
’s Entry
s is defined by the Text
itself,
not by the schema of the database. In this way, for example, one Text
could be a book, where each Entry
has a page number, while another
Text
could be an audio recording, where each Entry
has a timecode.
Second, while NYWalker was designed with open access to its data in mind, it
was implemented in an ad hoc manner, and the relationships between Place
s
and gazetteers was… inconsistent. Some places were linked to
GeoNames entries, and many places were not. With
Wandertext, Place
s will link to the WHGazetteer, contributing to a federated
system of geographical information management.
- Convert existing SQL database to sqlite for portability ✅
- Convert sqlite database (back) to Postgres ✅
- Build Wandertext client
- Deepen
Place
model to match Linked Places format.