What happens in Apache Atlas when two attributes collide? - apache-atlas

I am designing a governance model, and I would like to know what happens in apache atlas when I have 2 classifications (tags) collide with different attribute values?
Example
Revenue table (tag: certified; attribute: expires_on: 2023)
Customer table (tag: certified; attribute: expires_on: 2030)
I create a new table based on data from both tables. What happens to the attribute expires on?

Related

Convert Relational Database model to AGE database

I have made an ER diagram of course management system considering Relational Database.
Here is the picture:
[Course Management System] (https://i.stack.imgur.com/RBNfg.png)
How can I map these things in Apache AGE?
What will be the Vertices and what will be the Edges in this case?
I have ER diagram of Course Management System considering Relational Database Model. I want guidance in converting it to Apache AGE Database Model.
I can give you an idea to a certain extent.
Create a Graph with some name(e.g. Registration_Details)
The nodes/vertices will be Person.
Since there are two types of Person, you can use vertex label names to distinguish between them(label name as Student and Teacher and).
Properties of vertex with label name Student will be {'Student_ID': , 'Address': , 'CGPA': } and similarly for vertex with label name Teacher.
Now for Registration details, You'll be creating all possible edges between Student and Teacher. For every edge created you'll be adding properties of edges as well!
example
StudentA(vertex-{StudID: ,...}) ------- edge1({'RegId':123, 'CourseId':789, 'Marks': 80}) ------ TeacherA(Vertex)
I have not included StudentID and TeacherID in edge1 because in Apache AGE the edge already consists of information about the vertexIDs.
Hope this gives some head start for you.
As a rule of thumb, table names in relational databases become label names for vertices, table columns become the properties of those vertices, and the relationships between tables (defined by foreign keys in relational databases) become the edges between vertices.
However, while you could technically map relational databases 1:1 onto graph databases, this may not be the best approach because graphs can offer us more powerful design choices. Check out this blog post for more info:
https://maxdemarzi.com/2015/08/26/modeling-airline-flights-in-neo4j/
You should first write down the relationship between the tables as each table becomes a vertex and it has some properties which are the columns. Then each vertex(TABLE) is connected to another vertex(TABLE) through an edge(RELATIONSHIP). This edge would also have some properties depending upon how you want to utilize the data. You can take help from the here
You need to create a vertex type for each entity (table), and then define the edges that connect the vertices based on the relationships in the ER diagram. You will also need to define attributes for edges along with defining attributes for vertexes as needed.
In your ERD you have defined your tables now you just have to convert those tables into vertexes and the relationships between them would become edges between those vertexes. This means your tables here represent your vertex and your edges represent the relationship between those tables.

Entity Framework 6 - Inserting/Updating 2 table joined by a view

In my database I have
a Members table which contains basic member details (MemberId [primary key - auto generated number], MemberName, IsActive).
a MembersDetails table which contains more detailed information about the member (Address, Phone, Birthday ...). MembersDetails has MemberId field as a foreign key to the Members table.
There's a reason (part of the app logic) that the 2 tables are separated and are not all in one table.
I've created a view that gets a full member details (a join of the 2 tables), and Entity Framework created an object that represents the view.
I have 2 questions:
Is there a better way of flattening 2 joined tables into an object other than creating a view in the database?
I would like to create an object of the view type (a full user details), initialize it's properties and insert it to the database (which will put the info it needs in the Members table, the the generated id, and than insert to the MemberDetails table). Is there a way to do that?
Ad 1.
I think a database view will be a good choice for performance reasons.
But you can investigate an inheritance provided with the Entity Framework.
It allows you join two separated tables in one model object containing all properties (from "derived" and "base" table). Note, it will be OK for one to one relations (but not for one to many).
Implementing Inheritance with the Entity Framework 6 in an ASP.NET MVC 5 Application
Ad 2.
The Entity Framework inheritance will help you with this issue well. Alternatively, if you can use a database view, just create stored procedures for inserting and updating data included in a view, then map the stored procedures for specified actions on the view model generated by Entity Framework.

OO Design and the data model for change log function

: EJB 3, JPA (EcipseLink) and Oracle Database
An application has two entities: Group and Person. There is a one-to-many relationship.
The requirement is, that every changes of Group and Person must be saved for later to roll or show.
The 1st idea:
make the id and timestamp of the change/create as a composite primary key for Group and Person.
Every change will create a new object with the same id and new timestamp. For Example, a Group hat been changed, then create a new Group. but the relationship between Group and Person unchange. Here hat a problem: the constrait "one-to-many" will breaked!. Now one person hat the relation to two groups with the same id.
The 2nd idea:
for Group and Person create two another Entities GroupArchive and PersonArchive. In Group and Person only the lastest Infomation. Any changes will be copied and saved to Archive Entities. Between Group and GroupArchive hat a one-to-many relationship. And same for Person and PersonArchive.
Are my ideas realizable? Has anybody a better idea?

Where to place auditing fields?

In our shop, when we design a database, we typically include auditing attributes for each table (LastUpdateUser, LastUpdateDate, etc). This is common practice, however, I've noticed this becoming an increasing problem when you have tables that "inherit" from other tables, especially using tools such as the entity framework.
For example, if you have tables Customers and Employees, and those tables have a foreign key to table People, then in your entity / class model when you establish the inheritance, you need to change the names for the audit fields because they exist in both tables. Perhaps they need to become PersonLastUpdatedUser and PersonLastUpdatedDate, while the ones from Employees remain as simply LastUpdatedUser and LastUpdatedDate.
When designing tables for inheritance, do you put such audit fields in both tables, or do you just have them in the parent table and update the parent table whenever an attribute changes in a child table?
If you want to use inheritance than those attributes belong to parent table because the parent with related table forms single entity and you track auditing for whole entity. If you for any reason needs those attributes in both tables it should be the first warning that those tables are not good candidates for inheritance.
If you want true auditing, you create separate audit tables that are populated by triggers (never ever by the application or you will miss items that need to be audited).
and they shouw both the old and new value as well as the date and the user or application that made the change.
If you want a last updatedcolumn in each table (which I think is better than having it only in the parenta as that doesn't tell you anything about which of the tables changes last) and you want o use inheritance then you might need to create unique names by adding the table name to lastUpdated. So PersonLastUpdated and OrderLastUpdated, etc.
Or you don't use inheritance.

Tough Sql Query problem involving family relationsships

i have a many to many table relationship that involves 2 logical tables.
Record table that joins to a relation table on primaryID
Second instance of record table that joins to the relation table on ReciprocalID
The purpose of this is to show family relations within the database. Each primary Record table has one or more rows in the relationtable that shows everyother family relationship this person has in the database.
I have been tasked with trying to make a contact list that involves displaying the names of each of the children that attend this school along with their parents and contact information.
I have gotten to a point where I am able to show the children under each parent, but now I have to find a way to merge these together.
Since I have no control over the design of this database(its Education Edge 7) I have made a separate database that holds my queries and views for my reports. The school I am doing this work for only has access to CR 8.5.
Right now I have my top group in CR as the lastname of the recordstable, my second group is on the fullname of the recordstable. I have a subreport that pulls in all the child records.
I have used a case when statement in my primary view(the one described above) to convert 'daughter' and 'son' to child and 'mother' or 'father' to parent.
hopefully this hasnt rambled too much. If you need anymore information just ask.
SELECT dbo.vwEA7RelationshipsTableView.PRIMARYID,
dbo.vwEA7RecordsTableView.LASTNAME AS PRIMARYLASTNAME,
dbo.vwEA7RecordsTableView.FIRSTNAME AS PRIMARYFIRSTNAME,
dbo.vwEA7RecordsTableView.NAMEFORDISPLAY AS PRIMARYNAME,
CASE dbo.vwEA7RelationshipsTableView.PRIMARYDESC
WHEN 'Father' THEN 'Parent'
WHEN 'Mother' THEN 'Parent'
WHEN 'Son' THEN 'Child'
WHEN'Daughter' THEN 'Child'
ELSE dbo.vwEA7RelationshipsTableView.PRIMARYDESC
END AS PRIMARYDESC,
dbo.vwEA7RelationshipsTableView.RELATIONID,
vwEA7RecordsTableView_1.LASTNAME AS RELATIONLASTNAME,
vwEA7RecordsTableView_1.NAMEFORDISPLAY AS RELATIONNAME,
dbo.vwEA7RelationshipsTableView.RELATIONDESC
FROM dbo.vwEA7RelationshipsTableView INNER JOIN
dbo.vwEA7RecordsTableView ON
dbo.vwEA7RelationshipsTableView.PRIMARYID = dbo.vwEA7RecordsTableView.ID INNER JOIN
dbo.vwEA7RecordsTableView AS vwEA7RecordsTableView_1 ON
dbo.vwEA7RelationshipsTableView.RELATIONID = vwEA7RecordsTableView_1.ID
TableViews are really just recreation of the primary tables from the main database.
I have solved this issue. My sql code was good, it was a matter of formatting my internal paramaters for Crystal as well as some creative grouping.