Read a Fact
Read an arrow, pick the relationship that answers your question, then use two facts to check what someone claims.
Sections in this chapter
Read an arrow like a sentence
A friend texts you, “The café is inside the station.” Match their message to one of the drawings. Both arrows use the label is inside. Look at what changes when the arrow turns around.
- Café is inside Station
- Station is inside Café
Which drawing matches the message? Say the sentence for the other drawing before you check.
Check the two sentences
The first arrow matches the message because it starts at Café and ends at Station. In the second drawing the word “inside” still applies to the thing at the start, so it says “The station is inside the café.” The label stays the same and the recorded claim changes.
Imagine you are meeting a friend at a university library. A message says, “Meet me at the library on North Campus.” To make sense of it, you connect two things, the library and North Campus, through a relationship, is in. If someone draws a box for each place and an arrow between them, the arrow needs a label.
An unlabelled line could mean that both places are on the same bus route, that one is inside the other, or that someone needs to walk between them. The label tells you how to read that specific line.
- Library is in North Campus
Read from the tail through the relationship to the arrowhead. In the picture, you start at Library, say “is in,” and finish with North Campus.
You can also draw the original arrow from right to left on a page. As long as the tail is Library and the arrowhead is North Campus, its meaning stays the same. Layout can make a fact easier to notice, but the arrow gives the reading order.
The boxes are called nodes, and a labelled connection is an edge. Together, nodes and edges make a graph. In this course, think of a node as a place to start or finish a statement. Later you will trace several edges and check which statements work together.
Researchers describe knowledge graphs as a way to organise data about things and their relationships. For us, the first benefit is simple: a person reading the answer can point to the connections that support it. Hogan et al., Knowledge Graphs.
Reading habit: Begin at the tail, say the label, and finish at the arrowhead. If a sentence sounds odd, reread the arrow and check how the relationship was named.
Try reading one arrow
- Sam returned Map
Who returned what? Say the sentence before opening the explanation.
Get a hint
Find where the line starts. That box names the person or thing the statement is about.
Check your sentence
Sam returned the map. Sam is at the start, “returned” is the relationship, and the map is at the arrowhead. Reading the boxes in that order gives a sentence you can compare with the drawing.
Review the direction diagram · Continue to the three parts of a fact
Build an RDF triple
Now say “Alice studies at U1,” where U1 is the shortened name of a university in our example. Alice does the studying, so she goes at the start. “Studies at” describes the action that connects her to a university. U1 completes the statement.
RDF (Resource Description Framework) is a way of recording statements with fixed roles. Each statement has a subject, a predicate and an object. Together they are called a triple. The subject goes at the tail, the predicate labels the arrow, and the object goes at its head. W3C, RDF 1.1 Concepts, §3.1.
| Part | In this fact | In the picture |
|---|---|---|
| Subject | Alice | Box at the tail |
| Relationship (predicate) | studies at | Label on the arrow |
| Object | U1 | Box at the arrowhead |
Two facts can share a node
When reading a paragraph, find the smallest statements you could draw separately. “Alice studies at U1, a university with a campus in CityA” supplies two triples in this model. The first runs from Alice to U1. The second runs from U1 to CityA.
In the first statement U1 fills the object position. In the second it fills the subject position. The roles describe a triple. The same university can appear in either role.
Find the roles in a sentence
English gives you more than one way to arrange the same information. “U1 is the university Alice studies at” mentions U1 first, even though Alice is still the person doing the studying. Before you draw, try restating the sentence so its relationship comes between the two names. In this example that gives “Alice studies at U1” again.
This step helps when a question describes the answer first or when someone writes “the book written by Jo.” Decide which relationship the graph uses, then put each thing in the role that relationship calls for.
In these diagrams a fact is a statement the example data records. A real dataset can contain omissions or errors.
For “Alice studies at U1,” the useful action is to find the exact relationship and the two things it connects. If another line says “Alice visited U2,” that second line can be relevant to a question about visits. Your answer to “Where does Alice study?” should refer to the study line. Keeping those sentences separate preserves the difference when a computer searches the graph.
Read the relationship precisely
Two people can talk about the same situation with different sentences. “The library is in North Campus” starts with the library. “North Campus contains the library” starts with the campus and uses contains. In ordinary speech, the second is an acceptable way to express the same placement.
Drawing it requires two changes: reverse the ends and change the relationship label. If you just reverse the arrow, you keep the original wording and get “North Campus is in the library.” To check an unfamiliar edge, say out loud the sentence the data actually records.
Reverse the direction only. The campus becomes the thing inside.
- North Campus is in Library
Reverse the direction and use “contains”. This describes the original placement.
- North Campus contains Library
| Subject | Predicate | Object | How to read it |
|---|---|---|---|
| Library | is in | North Campus | The library is in North Campus. |
| North Campus | contains | Library | North Campus contains the library. |
| North Campus | is in | Library | This makes the campus the thing inside. |
The second row is an inverse relationship in this example: “is in” and “contains” describe the same placement from opposite sides. The first triple explicitly records “is in.” An RDF graph can also contain a “contains” triple, or a system can use stated rules to derive one. A simple match over the triples on this page looks for the edge that is present.
If a question begins with North Campus and asks what is in it, you can still find the Library by looking for an “is in” edge whose arrowhead is at North Campus. Read the matching edge in its original direction to explain why it qualifies.
Sometimes an editor gives two different relationships similar English labels. A campus guide might use “is inside” for a location and “is managed by” for who operates a building. Imagine a library run by the university but located on land owned by the city. Both relationships describe the same library.
A question about where to go uses the location edge, while a question about who to contact uses management. Finding one useful edge tells you where to keep looking. It also helps you put aside edges that concern a different question.
One pair, two relationships
The same pair of nodes can carry more than one relationship. Imagine that Mina borrowed a book and later recommended it to a friend. The library could draw one edge labelled “borrowed” and another labelled “recommended,” both going from Mina to the same book.
A friend asks whether Mina borrowed the book. Which arrow would you point to?
Get a hint
Both arrows begin and end at the same places. Compare the verb in the question with the labels in the drawing.
Check the relationship
Use the upper arrow, borrowed. It records what the friend asked about. The lower arrow records a recommendation and would be the one to use if the question asked what Mina recommended.
The two edges are distinct because their predicates differ. A search for recommendations should use the recommendation edge. If someone were merely standing near the book on a drawing, that proximity would not establish either fact. When reading a crowded graph, pick one arrow with the relationship you need, then check both of its ends.
Identify things and values
Suppose the library service lists a “Central Library” on two campuses. The two names look identical on a sign. When you make a booking, you still need to choose which building you mean.
Data can keep a stable identity for each building and store “Central Library” as the label for both. The building at North Campus can then have a different opening time from the one at South Campus.
Before following an edge, check the identity of the node. If a diagram shows the same short name twice, look for an identifying detail such as a campus or a reference number.
| Subject | Predicate | Object | Object in this statement |
|---|---|---|---|
| LibraryNorth | is in | North Campus | A place you can connect to other places |
| LibraryNorth | has public name | “Central Library” | A text value |
| LibraryNorth | has study desks | 40 | A number |
| LibrarySouth | has public name | “Central Library” | The same text value for a second building |
You are booking a desk on North Campus and both branches show “Central Library” on screen. Check the campus field or the branch identifier. The row with North Campus or LibraryNorth lets you make the booking for the intended branch. The public name applies to both.
Objects can be things or values
A place or a person can act as an object in one triple and then act as the subject of another. A value such as the text “Central Library” or the number 40 plays a different role. RDF calls values like these literals. A literal can be the object of a triple.
For example, the desk count ends the line that describes LibraryNorth. If someone asks who manages the desk area, that question needs a connection from the library or an entity representing its desk area. The number 40 describes the amount.
RDF commonly identifies a thing or relationship with an IRI, an identifier with a format familiar from web addresses. Later examples shorten those identifiers with ex:. For example, ex:U1 is the identifier for our one example university. The label printed inside the box is simply U1.
For this chapter, read the name and check which thing it identifies. The syntax for writing a query comes later. W3C, RDF 1.1 Primer, graph data model.
Repeated facts in a graph
There is one more useful distinction before you count anything. An RDF graph is a set of triples. If two records contribute exactly the same subject, predicate and object, the graph contains that triple once. Two distinct objects still make two different triples.
If a library record should distinguish two separate loans for the same book and reader, it can represent each loan with its own identifier and record details such as date on each loan. Simply copying an identical “borrowed” triple would record no new graph fact. W3C, RDF 1.1 Concepts, RDF graphs.
You can represent the same small graph as a picture or as a list with one triple per row. The library table above makes it easy to compare public names. A drawing makes it easy to see where each building sits and which edges share it.
To check that a drawing and a table describe the same facts, go row by row. Find the subject and object, confirm the predicate, and check which node the arrowhead touches.
When several edges meet at a single node, that node still stands for the same thing wherever it appears in a row. This gives you a way to check a diagram before relying on it to answer a question.
Follow two or more facts
Suppose a visitor asks, “Where does the university Alice studies at have a campus?” First find Alice’s “studies at” arrow and follow it to U1. That answers the question “Which university?”
Now keep that very university as the starting point of your search for campus arrows. CityA and CityB both follow from U1, so there are two relevant facts. You can then follow a further arrow from either city to find the country. The picture below shows the relevant part of the course graph.
Read the upper path as three sentences: “Alice studies at U1. U1 has a campus in CityA. CityA is in CountryZ.” The lower path has the same beginning and a different city. Both paths give evidence that a university Alice studies at has a campus in CountryZ. The diagram labels the relationship from Alice as studies at and the one from U1 as campus in.
Check what the evidence supports
To answer “Which campus does Alice use in person?” you would look for a statement that connects Alice to a particular campus, or a stated rule that provides that connection. The paths shown here leave her choice open.
| Question | Evidence to use | What the data supports |
|---|---|---|
| Where does Alice study? | The study edge out of Alice | U1 is directly recorded. |
| Where does that university have a campus? | The campus edges out of U1 | CityA and CityB are recorded campuses. |
| Which campus does Alice attend? | An attendance edge or another source that specifies the campus | The example leaves this unanswered. |
When there is no relevant edge, say what is missing. “The data does not tell us which campus Alice attends” is a precise answer about the evidence. It leaves room for attendance that the dataset does not record.
If you discover a campus edge for a different university, it belongs to that university. Check the exact node where you arrived before following a second arrow. In the next chapters this habit will carry over to query code: reusing a name helps a query keep the second condition tied to the first.
Worked example: two readers and a book
Take a library’s small teaching dataset with four facts. Nia borrowed City Gardens. Omar also borrowed City Gardens. Jo wrote City Gardens and Riverside Walks. The library recorded those statements separately.
Draw an arrow for each borrowing and an arrow from Jo to each work. The name City Gardens refers to one book, so the two borrowing arrows meet at the same node. To answer “Who wrote the book Nia borrowed?”, start with one arrow and keep its destination for the next step.
| Start | Relationship | Destination |
|---|---|---|
| Nia | borrowed | City Gardens |
| Omar | borrowed | City Gardens |
| Jo | wrote | City Gardens |
| Jo | wrote | Riverside Walks |
1. Find the book Nia borrowed
- Nia borrowed City Gardens
Nia is named in the question, so start there. The label “borrowed” tells you what to look for. Keep City Gardens for the next step. The question asks about the author of that specific book.
2. Find who wrote that book
- Jo wrote City Gardens
Now you know the book, so look at the arrows that end there. Jo wrote the book Nia borrowed. You can search from the book back to its author while still reading the fact in its original direction: “Jo wrote City Gardens.”
The other “wrote” row connects Jo to Riverside Walks. It can answer a question about that book. Here the evidence has to meet at City Gardens, the book you found in step 1.
Who borrowed City Gardens?
This time the book is given and the reader is the missing part. Find every “borrowed” arrow entering City Gardens. Nia and Omar both qualify.
Seeing two arrows enter the book does not by itself give the order or dates of their loans. A question about “Who borrowed it first?” would need some record of the loans and their times.
By asking which end is known, which relationship matters, and which part is missing, you can describe what a correct answer would need even before learning query syntax.
In Unit 2 you will replace the unknown part of a statement with a named blank and see how the graph can fill it. You can apply the same reading order here before you learn the symbols for asking that question.
Practice: read and trace facts
Use the order from the worked example. Read each choice as a sentence before checking which way its arrow points.
Need a reminder? Compare the two directions, then try again here.
Read a new fact
Now apply the same method to a city and a country. Start at the tail, say the relationship, and finish at the arrowhead.
Choose a relationship for the question
A community library records three activities. Maya borrowed the book River Walks. She also recommended River Walks. She borrowed Window Gardens. A visitor asks, “Which books did Maya borrow?” Write down the triples that support an answer. Then explain what changes when the visitor asks, “Which books did Maya recommend?” Work through the three statements before opening the reasoning.
Check the relationship
For the borrowing question, Maya is the subject and “borrowed” is the predicate. Two triples fit: Maya borrowed River Walks, and Maya borrowed Window Gardens. The matching objects are the two book names.
For the recommendation question, start at Maya again and change the predicate to “recommended.” Only the edge to River Walks fits that second search. A drawing can put both edges to the same book in parallel. In a list, the subject and object of those two triples match each other, but the predicate differs. If you listed both books as recommendations, revisit the sentence about Window Gardens and read its relationship.
Read a small inventory
A service desk imports the same row twice: LibraryNorth has study desks 40. A colleague adds a second row saying LibrarySouth has study desks 40. The two branches share the public name “Central Library.” If we draw the two desk counts as arrows, how many different triples will represent them? Explain what the two examples of 40 describe. Then say whether you could use the public name alone to pick one branch.
Check the identities and values
The graph has two distinct triples for the desk counts. Repeating the North row contributes the same subject, predicate, and object, so that fact is present once. The South row adds a second fact because its subject identifies a different building. Each 40 is a numeric value for the building where its edge starts.
The question “Which branch has 40 desks?” therefore has two supported answers in this small graph. The shared public name would match two branches as well. To refer to one branch or follow its other relationships, use a distinguishing identity such as LibraryNorth, or use the branch’s campus as another condition when that information is recorded.
Science fair challenge
The fair’s records show who submitted a poster and who judged it. A friend thinks Kira won a prize. Use the four facts below to work out what you could report from the records.
- KirasubmittedRiver poster
- EvanjudgedSky poster
- NoorjudgedRiver poster
- JojudgedRiver poster
- Find the entry. Which poster did Kira submit? Read the arrow that tells you.
- Find the judges. Who judged that poster? Name the arrows that support your answer.
- Check the prize claim. Can you tell whether Kira won? Name the kind of record that would let you check.
Say your reasons aloud or jot them down. Keep the poster name in your answer so you can check that your facts refer to the same entry.
Get a hint
Start at Kira. Follow submitted, then check which judged arrows end at that same poster.
Check your science fair reasoning
- KirasubmittedRiver poster
- EvanjudgedSky poster
- NoorjudgedRiver poster
- JojudgedRiver poster
Kira submitted the River poster. The submission arrow starts at Kira and ends at the River poster. Keep that poster in view as you look for judging records.
Noor and Jo judged the River poster. Their two judging arrows end at the same poster Kira submitted. Evan also has a judging arrow, but it ends at the Sky poster. The label fits the question and the destination rules that arrow out.
The records leave the prize question open. An entry can be submitted and judged whether or not it wins. To check the claim, you would need a prize result that links Kira’s entry to an award, or a complete list of winners for the fair.
If you picked a judge using the relationship label alone, revisit the borrowed-book example and compare where each arrow ends.
Ready to move on?
Read an arrow from start to finish, then point to the fact that supports your answer.