Pregunta

I need a dataset for a project which has a decent number(around a million) of RDF triples. I found a number of datasets on the net but all of them had the data in the triples in the form of URI's. I need a dataset where the data is completely in the form of string literals.

I need data in this format.

person1,isNamed ,‘Serge Abiteboul’  
person2,isNamed ,‘Rick Hull’  
person3,isNamed ,‘Victor Vianu’

I have very less or absolutely no idea on what RDF is and how to work with it. So can someone please help me on how to get data into this format or if there is a way to convert data from URI's into string literals.

¿Fue útil?

Solución

You can't have a RDF triple that consists of string literals only.

An RDF triple consists of subject, predicate and object. Subjects and predicates are always URIs. Objects can be URIs or (string) literals. (Subjects and objects could also be blank nodes, though.)

To describe data in RDF, you need URIs that represent the things/concepts/relationships.

See http://www.w3.org/TR/rdf-concepts/.


For your example you could use the popular FOAF vocabulary. In Turtle syntax it could look like:

<http://example.com/team/person1#me> <http://xmlns.com/foaf/0.1/name> "Serge Abiteboul" .
  • Here the URI http://example.com/team/person1#me (= subject) would represent the actual person (instead of a page about that person). If there isn't such an URI, you could create it yourself under your own domain (the FOAF vocabulary has various classes and properties to describe persons).
  • The URI http://xmlns.com/foaf/0.1/name (= predicate) is defined in the FOAF vocabulary:

    name - A name for some thing.

    […]

    The name of something is a simple textual string.

  • "Serge Abiteboul" (= object) is a string literal.

The datatype of object literals can be specified with XML Schema, e.g. "-5.0"^^xsd:decimal for a decimal number. The language of object literal strings can also be specified, e.g. "house"@en for an English string.


Of course you could use prefixes instead of using the full URIs all the time (but in the end it would still be URIs):

@prefix foaf: <http://xmlns.com/foaf/0.1/> .
@prefix ex: <http://example.com/team/> .

ex:person1#me foaf:name "Serge Abiteboul" .

So if you want to model data in RDF, you have to

  • find (or create) URIs for the abstract things you want to describe, and
  • find (or create) vocabularies/ontologies that define classes and properties (in the form of URIs) to describe the abstract things and their relationships.

Some popular vocabularies:

For persons and social networks, see FOAF. For online communities, see SIOC. For authorship and document metadata, see Dublin Core. For class hierarchies, see RDFS and SKOS. For products, see GoodRelations. For software projects, see DOAP. And so on.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top