# Exploring data¶

## Class hierarchy¶

To explore your data, navigate to Explore -> Class hierarchy. You can see a diagram depicting the hierarchy of the imported RDF classes by the number of instances. The biggest circles are the parent classes, and the nested ones are their children.

Note

If your data has no ontology (hierarchy), the RDF classes are visualized as separate circles instead of nested ones.

### Explore your data - different actions¶

• To see what classes each parent has, hover over the nested circles.

• To explore a given class, click its circle. The selected class is highlighted with a dashed line and a side panel with its instances opens for further exploration. For each RDF class, you can see its local name, IRI and a list of its first 1,000 class instances. The class instances are represented by their IRIs, which, when clicked, lead to another view where you can further explore their metadata.

The side panel includes the following:

• Local name;
• IRI (Press Ctrl+C / Cmd+C to copy to clipboard and Enter to close);
• Domain-Range Graph button;
• Class instances count;
• Scrollable list of the first 1,000 class instances;
• View Instances in SPARQL View button. It redirects to the SPARQL view and executes an auto-generated query that lists all class instances without LIMIT.
• To go to the Domain-Range Graph diagram, double click a class circle or the Domain-Range Graph button from the side panel.

• To explore an instance, click its IRI from the side panel.

• To adjust the number of classes displayed, drag the slider on the left-hand side of the screen. Classes are sorted by the maximum instance count, and the diagram displays only the current slider value.

• To administer your data view, use the toolbar options on the right-hand side of the screen.

• To see only the class labels, click the Hide/Show Prefixes. You can still view the prefixes when you hover over the class that interests you.
• To zoom out of a particular class, click the Focus diagram icon.
• To reload the data on the diagram, click the Reload diagram icon. This is recommended when you have updated the data in your repository, or when you are experiencing some strange behavior, for example you cannot see a given class.
• To export the diagram as an .svg image, click the Export Diagram download icon.

### Domain-range graph¶

To see all properties of a given class as well as their domain and range, double click its class circle or the Domain-Range Graph button from the side panel. The RDF Domain-Range Graph view opens, enabling you to further explore the class connectedness by clicking the green nodes (object property class).

• To administer your graph view, use the toolbar options on the right-hand side of the screen.

• To go back to your class in the RDF Class hierarchy, click the Back to Class hierarchy diagram button.
• To export the diagram as an .svg image, click the Export Diagram download icon.

## Class relationships¶

To explore the relationships between the classes, navigate to Explore -> Class relationships. You can see a complicated diagram, which by default is showing only the top relationships. Each of them is a bundle of links between the individual instances of two classes. Each link is an RDF statement where the subject is an instance of one class, the object is an instance of another class, and the link is the predicate. Depending on the number of links between the instances of two classes, the bundle can be thicker or thinner, and has the color of the class with more incoming links. These links can be in both directions. Note that contrary to the Class hierarchy, the Class relationships diagram is based on the real statements between classes and not on the ontology schema.

In the example below, you can see that Person is the class with the biggest number of links. It is very strongly connected to Feature and City, and most of the links are from Person. Also, you notice that all classes have many outgoing links to opengis:_Feature.

Left of the diagram, you can see a list of all classes ordered by the number of links they have, as well as an indicator of the direction of the links. Click on it to see the actual classes this class is linked to, again ordered by the number of links with the actual number shown. The direction of the links is also displayed.

Use the list of classes to control which classes to see in the diagram with the add/remove icons next to each class. Remove all classes with the X icon on the top right. The green background of a class indicates that the class is present in the diagram. You see that Person has much more connections to City than Village.

For each two classes in the diagram you can find the top predicates that connect them, again ordered and with the number of statements of this predicate and instances of these classes. Person is linked to City by the birthPlace and deathPlace predicates.

Please note that all these statistics are built on top of the whole repository, so when you have a lot of data, the building of the diagram may be fairly slow.

## Explore resources¶

### Explore resources through the easy graph¶

Navigate to Explore -> Visual graph. Easy graph gives you the opportunity to explore the graph of your data without using SPARQL. You see a search input field to choose a resource as a starting point for graph exploration.

A graph of the resource links is shown. Nodes that have the same type have the same color. All types for a node are listed when you hover over it. By default, what you see are the first 20 links to other resources ordered by RDF rank if present. See the settings below to modify this limit and the types and predicates to hide or see with preference.

The size of the nodes reflects the importance of the node by RDF rank. Hover over a node of interest to open a menu with four options. Click the expand icon to see the links for the chosen node. Another way to expand it is to double-click on it.

Click on the node to know more about a resource.

The side panel includes the following:

• a short description (rdfs:comment)
• labels (rdfs:label)
• RDF rank
• image (foaf:depiction) if present, and all DataType properties. You can search by DataType property if you are interested in a certain value.

You can click on the node again to hide the panel.

Note that you can switch between nodes without closing the side panel. Just click on the new node about which you want to see more, and the side panel will automatically show the information about it.

Once a node is expanded, you have the option to collapse it. This will remove all its links and their nodes, except those that are connected to other nodes also. See the example below. Collapsing “Eastern European Time” removes all nodes except Bulgaria, because Bulgaria is also linked to Sofia which is expanded.

If you are not interested in a node anymore, you can hide it using the remove icon. The focus icon is used to restart the graph with the node of interest. Use carefully, since it resets the state of the graph.

More global actions are available in the menu in the upper right corner. Use the arrows to visually rotate your graph for convenience.

Click on the settings icon to configure your graph globally.

The following settings are available:

• Maximum links to show is the limit of links to use when you expand each node.
• If you have labels in different languages, you can choose which labels to display with preference. The order is of importance in this case.
• Show/hide predicate labels is an option for convenience when you are not interested which predicates link the nodes.
• Preferred and ignored types/predicates is an advanced option. If you know your data well, you will be able to control to a bigger extent what to see when you expand nodes. If a preferred type is present, nodes of that type will be shown before all other types (see example below). Again, order matters when you have more than one preferred types. Ignored types are used when you do not want to see instances of some types at all while exploring. The same is valid for predicates. Use full IRIs for types and predicates filters.

For example, add http://dbpedia.org/ontology/Person as preferred type and tick the option to see only preferred types. Only links to Person instances are shown, related to Sofia.

### Create your own visual graph¶

Create your own custom visual graph by modifying the queries that fetch the graph data. To do this, navigate to Explore -> Visual Graph. In the Advanced graph section, click Create graph config.

The configuration consists of five queries separated in different tabs. A list of sample queries is provided to guide you in the process. Note that some bindings are required.

• Starting point - this is the initial state of your graph.
• Search box - start with a search box to choose a different start resource each time. This is similar to the initial state of the Easy graph.
• Fixed resource - you may want to start exploration with the same resource each time, i.e., select http://dbpedia.org/resource/Sofia from the autocomplete input as a start resource, so that every time you open the graph, you will see Sofia and its connections.
• Graph query results - visual graph can render a random SPARQL Graph Query result. Each result is a triple that is transformed to a link where the subject and object are shown as nodes, and the predicate is a link between them.
• Graph expansion - this is a CONSTRUCT query that determines which nodes and edges are added to the graph when the user expands an existing node. The ?node variable is required and will be replaced with the IRI of the expanded node. If empty, the Unfiltered object properties sample query will be used. Each triple from the result is visualized as an edge where subject and object are nodes, and each predicate is the link between them. If new nodes appear in the results, they are added to the graph.
• Node basics - This SELECT query determines the basic information about a node. Some of that information affects the color and size of the node. This query is executed each time a node is added to the graph to present it correctly. The ?node variable is required and will be replaced with the IRI of the expanded node. It is a SELECT query and the following bindings are expected in the results.
• ?type determines the color. If missing, all nodes will have the same color.
• ?label determines the label of the node. If missing, the IRI’s local name will be used.
• ?comment determines the description of the node. If missing, no description will be provided.
• ?rank determines the size of the node, and must be a real number between 0 and 1. If missing, all nodes will have the same size.
• Edge basics - This query SELECT the ?label binding that determines the text of the edge. If empty, the edge IRI’s local name is used.
• Node extra - This SELECT query determines the extra properties shown for a node when the info icon is clicked. It should return two bindings - ?property and ?value. Results are then shown as a list in the sidebar.

If you leave a query empty, the first sample will be taken as a default. You can execute a query to see some of the results it will produce. Except for the samples, you will also see the queries from the other configurations, in case you want to reuse some of them. Explore your data with your custom visual graph.

### Saved graphs¶

During graph exploration, you can save a snapshot of the graph state to load it later. The graph config you are currently using is also saved, so when you load a saved graph you can continue exploring with the same config.

## Viewing and editing resources¶

### View and add a resource¶

To view a resource in the repository, go to the GraphDB home page, and start typing in the Explore -> View resource field. The retrieved results can be in text format or in the form of a visual graph, with the latter automatically taking you to the Visual graph view. You can also navigate to a resource by clicking the SPARQL results links in the table that is returned below.

Viewing resources provides an easy way to see triples where a given IRI is the subject, predicate or object.

Even when the resource is not in the database, you can still add it from the resource view. Type in the resource IRI and hit Enter.

Here, you can create as many triples as you need for it, using the resource edit. To add a triple, fill in the necessary fields and click on the orange tick on the right. The created triple appears, and the Predicate, Object, and Context fields are empty again for you to insert another triple if you want to do so. You can also edit or delete already created triples.

To view the new statements in TriG, click the View TriG button.

When ready, save the new resource to the repository.

### Edit a resource¶

Once you open a resource in View resource, you can also edit it. Click the edit icon next to the resource namespace and add, change, or delete the properties of this resource.

Note

You cannot change or delete the inferred statements.