ORM Main schema

This is representing the applications working data schema. It provides buckets for general data you will need to run this application in standard mode. The buckets are:

  • Municipality

  • Real Estate

  • Address

  • Glossary

  • Exclusion of liability

The geographical projection system which is used out of the box is LV95 aka EPSG:2056. Of course you can configure a different one. The name of the schema will be:

pyramid_oereb_main

But you can change it also via Configuration.

Note

Whenever you configure your own sqlalchemy ORM’s to use them in this application you must imitate the behaviour of the ORM’s here. This means the names class variables as well as the types of these variables.

Address

class pyramid_oereb.contrib.data_sources.standard.models.main.Address(**kwargs)[source]

Bases: Base

The bucket you can throw all addresses in the application should be able to use for the get egrid webservice. This is a bypass for the moment. In the end it seems ways more flexible to bind a service here but if you like you can use it.

street_name

The street name for this address.

Type:

unicode

street_number

The house number of this address.

Type:

str

zip_code

The ZIP code for this address.

Type:

int

geom

The geometry of real estates border. For type information see geoalchemy2 docs dependent on the configured type. This concrete one is POINT

Type:

geoalchemy2.types.Geometry

__init__(**kwargs)

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

Availability

class pyramid_oereb.contrib.data_sources.standard.models.main.Availability(**kwargs)[source]

Bases: Base

Availability is a settings tabel where you can join municipalities to theme codes/sub theme codes and assign a published flag. This flag has to be False. Then the delivery of the PLR’s in this theme/sub theme within the municipality is blocked. This is useful to publish OEREB data step by step based on municipality.

Note

Core handles no found match in this table as it would be published. So you can either fill this table with all combinations of themes/sub themes and municipalities and set published to True (explicit configuration) or leave the table empty (implicit configuration). Both leads to published data.

id

The identifier of this list. It is used in DB only.

Type:

str

municipality_fosnr

The municipality identifier which the switch element belongs to.

Type:

int

theme_code

the theme code which this switch element belongs to.

Type:

str

available

Switch wether the element is published or not.

Type:

bool

__init__(**kwargs)

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

DataIntegration

class pyramid_oereb.contrib.data_sources.standard.models.main.DataIntegration(**kwargs)[source]

Bases: Base

The bucket to fill in the date when this whole schema was updated. It has a relation to the office to be able to find out who was the delivering instance.

id

The identifier. This is used in the database only and must not be set manually. If you don’t like it - don’t care about.

Type:

str

date

The date when this data set was delivered.

Type:

datetime.date

theme_code

the theme code which this switch element belongs to.

Type:

str

office_id

A foreign key which points to the actual office instance.

Type:

str

office

The actual office instance which the id points to.

Type:

pyramid_oereb.standard.models.airports_building_lines.Office

checksum

A checksum to persist the data state which is in the db. It is thought to be a helper field to check if import is necessary.

Type:

str

__init__(**kwargs)

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

Disclaimer

class pyramid_oereb.contrib.data_sources.standard.models.main.Disclaimer(**kwargs)[source]

Bases: Base

The bucket you can throw all disclaimers in the application should be able to use.

id

identifier and primary key, used in the database only

Type:

str

title

The title which the disclaimer item has.

Type:

str

content

The content which the disclaimer item has.

Type:

str

extract_index

index to sort the disclaimers in the extract

Type:

int

__init__(**kwargs)

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

DocumentTypeText

class pyramid_oereb.contrib.data_sources.standard.models.main.DocumentTypeText(**kwargs)[source]

Bases: Base

The element holding the different document types and their translations.

code

The identifier given by a code

Type:

str

title

The display name for the document type

Type:

str

__init__(**kwargs)

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

GeneralInformation

class pyramid_oereb.contrib.data_sources.standard.models.main.GeneralInformation(**kwargs)[source]

Bases: Base

The bucket to store the general information about the OEREB cadastre

id

identifier and primary key, used in the database only

Type:

str

title

The title of the general information (multilingual)

Type:

dict

content

The actual information (multilingual)

Type:

dict

extract_index

index to sort the items in the extract

Type:

int

__init__(**kwargs)

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

Glossary

class pyramid_oereb.contrib.data_sources.standard.models.main.Glossary(**kwargs)[source]

Bases: Base

The bucket you can throw all items you want to have in the extracts glossary as reading help.

id

identifier and primary key, used in the database only

Type:

str

title

The title or abbreviation of a glossary item.

Type:

str

content

The description or definition of a glossary item.

Type:

str

__init__(**kwargs)

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

LawStatus

class pyramid_oereb.contrib.data_sources.standard.models.main.LawStatus(**kwargs)[source]

Bases: Base

The container where you can throw in all the law status texts this application should have access to, for creating extracts. .. attribute:: code

The identifier on federal level.

type:

str

title

The text for the multilingual text.

Type:

JSONType

__init__(**kwargs)

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

MapLayering

class pyramid_oereb.contrib.data_sources.standard.models.main.MapLayering(**kwargs)[source]

Bases: Base

id

identifier and primary key, used in the database only

Type:

str

view_service

Darstellungsdienst

Type:

dict

layer_index

Index for sorting the layering of the view services for a theme

Type:

int

layer_opacity

Opacity of a view service

Type:

float

__init__(**kwargs)

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

Municipality

class pyramid_oereb.contrib.data_sources.standard.models.main.Municipality(**kwargs)[source]

Bases: Base

The municipality is the place where you hold the information about all the municipalities you are having in your canton. This is used also in the applications process to check whether a municipality is published or not.

fosnr

The identifier of the municipality. It is the commonly known id_bfs or as or nofs in the french part.

Type:

int

name

The Name of the municipality.

Type:

str

published

Switch whether a municipality is published or not. This has direct influence on extract generation.

Type:

bool

geom

The geometry of municipality borders. For type information see geoalchemy2 docs dependent on the configured type. This concrete one is MULTIPOLYGON

Type:

geoalchemy2.types.Geometry

__init__(**kwargs)

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

RealEstate

class pyramid_oereb.contrib.data_sources.standard.models.main.RealEstate(**kwargs)[source]

Bases: Base

The container where you can throw in all the real estates this application should have access to, for creating extracts.

id

The identifier. This is used in the database only and must not be set manually. If you don’t like it - don’t care about.

Type:

int

identdn

The identifier on cantonal level.

Type:

str

number

The identifier on municipality level.

Type:

str

egrid

The identifier on federal level (the all unique one…)

Type:

str

type

The type of the real estate (This must base on DM01)

Type:

str

canton

Which canton this real estate is situated in (use official shortened Version here. e.g. ‘BE’)

Type:

str

municipality

The name of the municipality this real estate is situated in.

Type:

str

subunit_of_land_register

The name of the maybe existing sub unit of land register if municipality in combination with number does not offer a unique constraint. Else you can skip that.

Type:

str

subunit_of_land_register_designation

The maybe existing cantonal description of the subunit_of_land_register e.g. «Grundbuchkreis», «Sektion», «Fraktion» etc.

Type:

str

fosnr

The identifier of the municipality. It is the commonly known id_bfs.

Type:

int

metadata_of_geographical_base_data

A link to the metadata which this geometry is based on which is delivering a machine readable response format (XML).

Type:

str

land_registry_area

The amount of the area of this real estate as it is declared in the land registers information.

Type:

str

limit

The geometry of real estates border. For type information see geoalchemy2 docs dependent on the configured type. This concrete one is MULTIPOLYGON

Type:

geoalchemy2.types.Geometry

__init__(**kwargs)

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

RealEstateType

class pyramid_oereb.contrib.data_sources.standard.models.main.RealEstateType(**kwargs)[source]

Bases: Base

The container where you can throw in all the real estates type texts this application should have access to, for creating extracts.

id

identifier and primary key, used in the database only

Type:

str

code

The identifier on federal level.

Type:

str

text

The text for the multilingual text.

Type:

str

__init__(**kwargs)

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

Theme

class pyramid_oereb.contrib.data_sources.standard.models.main.Theme(**kwargs)[source]

Bases: Base

The OEREB themes of the application

id

identifier and primary key, used in the database only

Type:

str

code

OEREB code of the theme - unique and used to link each PublicLawRestriction with the corresponding theme

Type:

str

sub_code

OEREB sub_code of the sub-theme: only available for sub themes.

Type:

str

title

the title of the theme as a multilingual dictionary

Type:

dict

extract_index

index to sort the themes in the extract, defined in the specification

Type:

int

__init__(**kwargs)

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.

ThemeDocument

class pyramid_oereb.contrib.data_sources.standard.models.main.ThemeDocument(**kwargs)[source]

Bases: Base

Meta bucket (join table) for the relationship between theme and documents. .. attribute:: theme_id

The foreign key to the theme which has relation to a document.

type:

str

document_id

The foreign key to the document which has relation to the public law restriction.

Type:

str

theme

The dedicated relation to the theme instance from database.

Type:

Theme

document

The dedicated relation to the document instance from database.

Type:

Document

article_numbers

relevant articles for the theme document relation

Type:

dict

__init__(**kwargs)

A simple constructor that allows initialization from kwargs.

Sets attributes on the constructed instance using the names and values in kwargs.

Only keys that are present as attributes of the instance’s class are allowed. These could be, for example, any mapped columns or relationships.