Are RDF and RDFS two separate documents?
Asked Answered
P

3

5

When writing RDF and RDFS are you supposed to create a single document covering both? or create two separate documents? Similar to xml and xmls.

Panamerican answered 10/4, 2018 at 13:33 Comment(2)
Can you clarify your question, eg. through a clear use cases or examples?Overweigh
@nico I am tasked with using RDF and RDFS to model a database. I am unsure when modeling the database whether or not I should create a single file for RDF and another for RDFS or if you should cover both in one.Panamerican
H
4

Either approach is fine, and this is simply down to your own preference. In fact you can split your RDF(S) data between one, two, or more files however you want.

Some things to keep in mind: for small/simple datasets, having everything in a single file may be more convenient, but once you start working with a larger schema (or a lot more instance data), having some separation might make handling the data more flexible.

Hoedown answered 11/4, 2018 at 0:5 Comment(0)
T
4

I think this really comes down to a question of reusability. For instance, at present you have:

  • A. a schema
  • B. a collection of some instance data

Given that you have those two things, you have two options:

  • X. a single document with schema (+) and instance data
  • Two documents:
    • Y.1 one for schema (**)
    • Y.2 one the collection of instance data

Now, if expect in the future to have another collection of instance data, that's distinct from the first, then have a two options:

  • two documents:
    • X.1 one with the schema (+) and first collection of instance data
    • X.2 one with the schema (+) and second collection of instance data
  • three documents:
    • Y.1 one with schema (**)
    • Y.2 one with first collection of instance data
    • Y.3 one with second collection of instance data

If you take the second approach, you'll end up with three documents, but the one marked (**) carries over from the first, and you don't have to worry about keeping it in sync. In the first approach, you end up needing to make sure that the copy of the schema marked (+) is the same in both cases, and you're duplicating that information in multiple places.

In practice, which of these is more important probably depends on what you expect to have to handle in the future.

Toddy answered 11/4, 2018 at 16:56 Comment(0)
L
3

ABox vs. TBox

I think you aren’t asking about RDF vs. RDFs, but about ABox (assertion component) vs. TBox (terminological component).

@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
@prefix ex: <http://example.com/vocabulary/> .

# TBox
ex:Person rdf:type rdfs:Class .
ex:hasName 
  rdf:type rdf:Property ;
  rdfs:range rdfs:Literal .
  # not using rdfs:domain, because other things than ex:Person could have an ex:hasName

# ABox
<https://example.com/team/alice#i> 
  rdf:type ex:Person ;
  ex:hasName "Alice" ;
  rdfs:seeAlso <https://example.com/team/alice> .

As this example shows, both parts (ABox and TBox) can make use of both vocabularies (RDF and RDFS). It wouldn’t make sense to separate these statements based on their use of RDF and RDFS.

Separate documents?

Whether or not to have the TBox and the ABox in the same document primarily depends on your workflow. Go with what’s easier for you.

Posssible reasons for having separate documents:

  • Others might want to make use of the terms defined in your TBox for their own data. They can get the document with your TBox (e.g., to import it into their ontology tool) without getting the ABox (which they might not even be interested in).

    (And vice-versa. Some might only be interested in your ABox.)

  • Your ABox might become so big that it’s no longer feasible to have it in one document. Instead of repeating your TBox in every document (unnecessary), or instead of having it only in the first one (inconsistent), you can have the TBox in its own document, and the ABox in multiple documents.

  • If you want to use different syntaxes for the ABox and the TBox (for whatever reason).

Lizalizabeth answered 12/4, 2018 at 16:32 Comment(1)
I'd also add that when moving from RDFS to OWL, sometimes it is not possible to keep "TBox" and "ABox" as separate documents. E. g. :Alcohol owl:oneOf (:Vodka :Champagne :Bourbon :Tequila :Whiskey).Shipman

© 2022 - 2024 — McMap. All rights reserved.