File: instances_test.c

package info (click to toggle)
liblrdf 0.6.1-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 472 kB
  • sloc: ansic: 2,002; makefile: 33; sh: 28
file content (41 lines) | stat: -rw-r--r-- 944 bytes parent folder | download | duplicates (8)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
#include <stdio.h>
#include <stdlib.h>

#include "lrdf.h"

int main(int argc, char*argv[])
{
	const char *rdf_uris[] = {
		"file:ladspa.rdfs",
	       	"file:///usr/local/share/ladspa/rdf/swh-plugins.rdf",
		 NULL
	};
	lrdf_uris *ulist;
	unsigned int i;

	lrdf_init();
	if (lrdf_read_files(rdf_uris)) {
                fprintf(stderr, "failed to open a file\n");
		exit(1);
        }

	printf("Instances of http://ladspa.org/ontology#Plugin\n");
	ulist = lrdf_get_all_instances("http://ladspa.org/ontology#Plugin");
	for (i = 0; ulist && i < ulist->count; i++) {
		printf("  %s\n", ulist->items[i]);
	}
	printf("\n");
	lrdf_free_uris(ulist);

	printf("Instances of http://ladspa.org/ontology#FilterPlugin\n");
	ulist = lrdf_get_all_instances("http://ladspa.org/ontology#FilterPlugin");
	for (i = 0; ulist && i < ulist->count; i++) {
		printf("  %s\n", ulist->items[i]);
	}
	printf("\n");
	lrdf_free_uris(ulist);

	lrdf_cleanup();

	return 0;
}