ERD - How to show an entity can have a list of an attribute - erd

I tried searching google but couldn't find the answer.
Let's say my entity is "Question", and a question can have many "topics".
How do i represent that in an ERD?
rectangle represents an entity.
oval represents an attribute.
etc.
For example i made a question (this one) and i have 2 topics (erd and er-diagrams).

Related

Is it possible in sketchup, to have one face in multiple groups/layers?

i wana to make simple plugin in sketchup, but first of all i need to understand how sketchup works. So i played with faces, shapes, groups and layers as little kid, but there is something that blows my mind.
Is here even posible, to have one face in two groups? Or probably layer, but group will be much better. For example, i have a house which i wana to split into two zones (house + garage for example) and i know, that between this two rooms is only one wall, but it belongs to house (living part) and to garage. I would like to have garage and house (living part), but im not able to click this one in sketchup. If needed i can provide image, but i think its enough explained.
If you add a face in a ComponentDefinition and place ComponentInstances in the model that face will exist in several places in the model. Groups are like component instances - but they are made unique when you edit them.
For more details you can read this article: http://www.thomthom.net/thoughts/2012/02/definitions-and-instances-in-sketchup/

Getting the best category for a topic in Freebase

How to get the best (top) category for a topic ?
For example the movie "Life Is Beautiful" has a notable type "Award-Winning Work". I can not use this category. I'd like to know that, over all categories, the best choice is "/film/film" and not "/award/award_winning_work".
Is it possible to get the top category for a item ?
Thanks for your ideas,
Mickael.
#TomMorris: Yes, "category" in my context, means "type".
But for a particular topic, there could be many many types and I don't know which to choose without actually making some choices, for example decide that if "/film/film" is present, then it is the best category for my topic.
I would have imagined that Freebase would provide this "main type" out of the box. If you read the description of notable_type you can read "The way a topic's notable types is calculated is rather complex." If Freebase provide this service that requires complex calculation, then why not provide another service that would be something like a "main type" that would be the top type, that is, the top of the ontonlogy classification (a caniche is a dog which is a animal, etc... and somewhat stop at a significant level like "animal" that I would consider as my "main type"). Simply put, "Award Work" is not a good description of the topic "Life is beautiful". "Film" is a better description of it.
I am afraid you're right. I need to make my own choices betwwen all the "types" of the topics.
I don't know if you refer to the the dumps or to one of the Api's.
Regarding the API's please check the search API (link below). There results includes score and notable type which attempts to indicate what is the most relevant entity with the name you are looking for. You can also include additional properties in the results but this is the basic result.
Regarding working directly from the dumps - I haven't found a solution for that except of implementing some mechanism myself.
https://www.googleapis.com/freebase/v1/search?query=Life+is+beautiful&limit=10

Graph data modeling assistance relating to soccer matches

I am trying to model soccer matches and the referees and teams that play in them. I want to create nodes based on matches, referees, and players and am not clear on the best approach to model them? That is should I model it after cities, matches? Do I create a root node Id etc?
The kind of information I would looking for later would be stuff like:
1). Show all the matches for a particular referee (could be in multiple cities)
2). Show all matches where referee worked and home team won
3). show all referees that that have the highest count of wins for the home team?
4). show most active refereess in a particular city
As you can see there are all sorts of questions and for someone new this can be a little overwhelming. While I am reading some books, I wanted to see if any experts could help me in the scenario above. Again not sure if I need a root node that connects all the cities and referees and matches or just keep things independent. Your feedback would be most appreciated.
One of the possible models that at the moment seem to satisfy the queries you've posted:
(Team)-[:PLAYS]->(Match)
(Match)-[:HAS_REFEREE]->(Referee)
(Match)-[:PLAYED_IN]->(City)
The PLAYS relation could have a property to indicate if the team was the home team. You could also have a property on the PLAYS relation to indicate whether that team won or not. Or if winning is a big part of what you're looking for, you can create an extra relation such as
(Team)-[:WON]->(Match) (though then you need to think about how to model draws. The absence of a WON relation on either of the two teams for a match could indicate a draw maybe).
1) All matches for a particular referee: Start at the referee, traverse through the Match to the Cities. You might index some unique property of the referee to be able to look him up quickly
2) All matches where the referee worked and the home team won: Start at the referee, find all his matches, filter on the WON relation/property and the home team property
3)All referees that have the highest count of wins for the home team: Same as above, start at all referees
4)Most active referees for a city: Start at the city, find all matches and their referees
You might move things around a bit depending on more questions that you want to answer (especially home team properties, WIN/LOSE relations or properties etc.)
And I don't think you need the root node at all. You can index all matches/cities/referees etc if you want to find all of them
I've done some modelling of football/soccer matches which might be interesting to look at - http://staging.thinkingingraphs.com/
Mostly the same as what Luanne said although I've got specific relationship types indicating which team played at home and away. I've been writing up what I discovered while building out the model here as well - http://www.markhneedham.com/blog/tag/neo4j/page/2/

Filter out nodes that refer to a specific kind of node

I have a node type (reviews) that uses CCK to refer to another kind of node (either books or videos). Is there a way for me to use Views so that I can show only Reviews of Books or only Reviews of Videos?
I've tried creating a Relationship in the View and using a parameter, but that doesn't seem to work.
Are you using a CCK node reference field? If so this documentation may help get you started: http://drupal.org/node/289738
I was able to get my client to agree to a change, so that each node gets a radio button to mark what kind of review it is. That means that users will have to select the book/video and then say which type it is, but they are college-educated and hopefully this won't be beyond them.
So then I can add the review type into my Filters, and show only book reviews or video reviews that way. I suspect that my initial question is impossible without a lot of hacking.
You can do this with Views 3, which may not be a solution for you at all. :/
You add a required relationship based on your node reference, and then add a filter on node type of book/movie. The filter's 'Use relationship' should be set to the required relationship you set up previously.

Drupal 6 Views: Constraining fields which are not the "primary" node

I'm making a custom list of nodes and their comments. I'd like to be able to both constrain the number of nodes (easy: Items per page refers to nodes in this case) but also constrain the number of comments displayed per node (e.g. the 5 most recent):
Node number one
Comment 1-3
Comment 1-2
Comment 1-1
Node number two
Comment 2-7
Comment 2-6
Comment 2-5
Comment 2-4
Comment 2-3
Node number three
So Node number one has three comments. Fine. And Node number three has no comments. Also fine. But Node number two has seven comments; but I only want to show the most recent five.
Is there any way of doing this in Views? It's easy enough to make a view which has the comments in and an argument to provide the node id, were it possible to include such a view inside another view, for example.
I'm brand new to Drupal, so apologies if it's an obvious question. I've googled it, but it's hard to know if you're googling the right thing when you've just started.
Any suggestions appreciated!
Rob
according to the views developper here http://drupal.org/node/353872
is almost impossible to do in just one query, and as such is something Views can't support.
however, these modules might be interesting for you:
Views Group By or Views Attach and might be a step closer to the solution.
I can't think of an easy way to do this in views alone. You might need to do a combination of views and a little custom code to get the final result :/

Resources