<p>There's a lot to unpack here and I don't know about Goguen's institutions. But perhaps I can give a partial answer to your question.</p>

<p>Let's start with <a href="https://www.w3.org/TR/rdf11-mt/#simple-interpretations" rel="nofollow noreferrer">"simple interpretations"</a> of RDF, as defined by the spec, forgetting about richer languages like RDFS or OWL. If we ignore IRIs and literals, as in the first part of your question, then an RDF model is a simple object: an edge-labeled graph, whose vertices are resources, edges are triples, and edge labels are predicates.</p>

<p>To view RDF models as a category of models, we can use a variation of the <em>graph indexing category</em>, as discussed, for example, in David Spivak's book on <a href="https://arxiv.org/abs/1302.6946" rel="nofollow noreferrer">category theory for the sciences</a>. Define a category <span class="math-container">$\mathbf{RDF}_0$</span> with three objects <span class="math-container">$T$</span>, <span class="math-container">$R$</span>, and <span class="math-container">$P$</span>, representing the triples, resources, and properties, and three morphisms <span class="math-container">$subj: T \to R$</span>, <span class="math-container">$pred: T \to P$</span>, <span class="math-container">$obj: T \to R$</span>, representing the subject, predicate, and object of a triple. An <em>RDF model</em> is a functor <span class="math-container">$M: \mathbf{RDF}_0 \to \mathbf{Set}$</span>. There is a functor category of all such models, whose morphisms are natural transformations. Under this definition, a morphism of RDF models is just a label-preserving graph homomorphism.</p>

<p>IRIs and literal can be incorporated within this general approach. Define a new category <span class="math-container">$\mathbf{RDF}$</span> consisting of the objects and morphisms of <span class="math-container">$\mathbf{RDF}_0$</span>, plus two additional objects <span class="math-container">$IRI$</span> and <span class="math-container">$L$</span>, representing the IRIs and literals, and two additional morphisms <span class="math-container">$iri: IRI \to R + P$</span> and <span class="math-container">$lit: L \to R$</span>, representing interpretations of the IRIs and literals as resources and/or properties. Here the sum of objects (<span class="math-container">$+$</span>) is a coproduct (disjoint union). We can handle the sum in multiple ways. We can say that <span class="math-container">$\mathbf{RDF}$</span> is the free cocartesian category generated by the above objects and morphisms. Or we can think of <span class="math-container">$\mathbf{RDF}$</span> as a <a href="https://ncatlab.org/nlab/show/sketch" rel="nofollow noreferrer">sketch</a>.</p>

<p>On this definition, an <em>RDF model</em>, as defined by the "simple interpretations" of the RDF 1.0 spec, is a (coproduct-preserving) functor <span class="math-container">$M: \mathbf{RDF} \to \mathbf{Set}$</span>. As before, morphisms of RDF models are natural transformations between such functors.</p>

<p>That's all I have time to say right now. If you're interested, I can describe a different way of thinking about this problem that lends itself better to richer systems like RDFS or OWL.</p>

CC BY-SA 4.0
2018-09-25T07:17:56.510Z
The notion of a sketch has come up before in this context, and I need to study your answer more carefully, which will take a bit of time. But it is very helpful to have such criss crossing views on a topic. I'd be interested to see what you think would be a more appropriate model for RDFS and OWL. Institution Independent Model Theory helps for example show that blank nodes can be explained by a morphism from a literal+IRI signature Σ to a Σ+X where X stand for blank nodes. Any such morphism :  Σ → Σ+X is a blank node instantiation. That helps explain bnodes in one simple move.
Henry Story
CC BY-SA 4.0
2018-10-01T13:01:50.737Z
does [my answer](https://cstheory.stackexchange.com/a/41670/50651) look like it is isomorphic to yours, @EvanPatterson ?
Henry Story
CC BY-SA 4.0
2019-09-05T16:01:15.977Z
I also found the paper by Spivak "Functorial Data Migration" https://www.sciencedirect.com/science/article/pii/S0890540112001010 
very helpful and clear. It turns out that RDF there is a Grothendieck Construction from a Database Instance which is a funtor from a small category to set.
Henry Story
CC BY-SA 4.0
2019-09-05T19:55:08.220Z
Ah I found your paper "Knowledge Representation in Bicategories of Relations" which mentions OWL.
Henry Story
CC BY-SA 4.0
2018-09-24T04:13:15.790Z
2018-09-24T06:49:14.090Z
2018-09-24T06:49:14.090Z
Evan Patterson
<p>My supervisor thought the problem with the above view of the model from the IT point of view is that it forgets the interpretation part in the range of the Mod functor. Indeed the above definition of Mod takes a signature to a category of pure models. But if one thinks of things this way then one would end up with an Institution being much closer to what David Lewis called a language or indeed we call a language: that is a particular assignment of words/sentences to meanings via a grammar.</p>

<p>If we look at the definition of the Bare RDF Institution BRDF in the article “<a href="http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.119.5368&amp;rep=rep1&amp;type=pdf" rel="nofollow noreferrer">Semantic web languages–towards an institutional perspective</a>” [1] we indeed find the following definition for a signature <span class="math-container">$\Sigma$</span> consisting just of a set <span class="math-container">$RR$</span> of resource references</p>

<blockquote>
  <p><span class="math-container">$RR$</span>-models I are tuples <span class="math-container">$I = (R_I, P_I, S_I, ext_I)$</span>, where <span class="math-container">$R_I$</span> is a set of resources, <span class="math-container">$P_I$</span> is a subset of <span class="math-container">$R_I (P_I ⊆ R_I)$</span> - the set of properties, <span class="math-container">$S_I : RR → R_I$</span> is a mapping function that maps each resource reference to some resource, and <span class="math-container">$ext_I : P_I → \mathscr{P}(R_I × R_I)$</span> is an extension function mapping each property to a set of pairs of resources that it relates.</p>
</blockquote>

<p>Clearly their use of I suggests they were also thinking in terms of an interpretation, not a model. We can rearrange that structure to <span class="math-container">$I = (S_I, (R_I, P_I, ext_I))$</span> or even more concisely to <span class="math-container">$I = (S_I,M_I)$</span> where <span class="math-container">$S_I: RR \to R_I$</span> is the semantic function, and <span class="math-container">$M_I ⊆ R_I \times P_I \times R_I$</span> is our model of triples. </p>

<p>If that is correct then the name Mod in institution theory is a bad name for a such a functor, as it suggests a model, and that can be used as say David Lewis would to mean a possible world for example, or sets of those, One would then expect there to many functors from a signature to a model, one for each language, whereas we actually have one mapping from a signature to a category of interpretations. Calling such a Functor <span class="math-container">$Int$</span> would be more intutive, but that clashes with the wide useage for integers in computing. So I thought one may want to use the ☿ symbol for Mercury the Roman version of the greek god Hermes, the god of interpretation. The discussion on that subtopic could continue <a href="https://nforum.ncatlab.org/discussion/9012/institution/" rel="nofollow noreferrer">on ncatlab institution entry</a></p>

<p>[1] Lucanu, Dorel, Yuan Fang Li, and Jin Song Dong. 
“Semantic web languages–towards an institutional perspective.” 
Algebra, Meaning, and Computation. Springer, Berlin, Heidelberg, 2006. 99-123.</p>

CC BY-SA 4.0
2018-10-01T10:22:50.473Z
2018-10-01T10:29:13.390Z
2018-10-01T10:29:13.390Z
Henry Story
<h1>The Question in short</h1>
<p>Here is the question in its pure form. Details of my reasoning can be found below.</p>
<p>The RDF1.1 spec semantics defines a model to consist of a set IR of objects and IP of predicates. The way they define a Model is Isomorphic to the following type definition.</p>
<p><span class="math-container">$RDFModel = \mathscr{P}(IR \times IP \times IR)$</span></p>
<p>Note that any Model is thus a <a href="https://ncatlab.org/nlab/show/quiver" rel="nofollow noreferrer">Quiver</a> as can be seen by noticing that for any <span class="math-container">$M: RDFModel$</span> the first and third projections give us the functions we need:</p>
<p><span class="math-container">$ \pi_1, \pi_3: M \to IR$</span></p>
<p>so that the graph representation of a model below is justified.</p>
<p>Anyway since RDFModel is a powerset one can look at it as a poset category where the element Models built from a set of Resources R and Predicates P are the objects, and the morphisms are the subset relations. Call this category <span class="math-container">$\Bbb{M}_{RP}$</span></p>
<p>Questions:</p>
<ol>
<li>Is such a Poset category <span class="math-container">$\Bbb{M}_{RP}$</span> what an RDF Institution would send a Signature <span class="math-container">$\Sigma$</span> to? Ie is this the right type <span class="math-container">$ Mod(\Sigma): \Bbb{M}_{RP}$</span> ?</li>
<li>Since there can be many such categories of different sizes depending on IP and IR (<a href="https://www.w3.org/TR/rdf11-mt/#finite-interpretations-informative" rel="nofollow noreferrer">Appendix B: Finite Interpretations</a>), it is likely that these categories of poset can form a category which we could call <span class="math-container">$\Bbb{M}$</span>. (Somewhat like the category of boolean algebras). Is that the category that the functor <span class="math-container">$Mod$</span> has as range? Ie. <span class="math-container">$Mod: Sig^{op} \to \Bbb{M}$</span></li>
<li>In the category <span class="math-container">$\Bbb{M}$</span> what is the smallest category (initial or final object?)</li>
<li>Any category <span class="math-container">$\Bbb{M}$</span> contains many models so for any such model some sentences will be satisfied others not. In modal logics those are thought of as possible worlds. But in David Lewis' sense those are complete objects. It looks like possible worlds must be fixed points - or final objects - in a category of models of ever increasing size. Is there a way to capture these purely category theoretically? (Also can one call those mini models possible worlds?)</li>
<li>Is there a way to state how the open world assumption works in this context?</li>
</ol>
<h1>Context of the Question</h1>
<p>The <a href="https://www.w3.org/TR/rdf11-mt/#simple-interpretations" rel="nofollow noreferrer">RDF1.1 semantic spec</a> comes with a simple model discussed in a <a href="https://math.stackexchange.com/questions/2905226/what-kind-of-categorical-object-is-an-rdf-model/2905287#2905287">previous Stack Exchange question</a>. The aim of this question is to see how that can be brought into the larger space of <a href="https://en.wikipedia.org/wiki/Institution_(computer_science)" rel="nofollow noreferrer">Category Theoretical Institutional Theory</a> started by the famous computer scientist <a href="https://en.wikipedia.org/wiki/Joseph_Goguen" rel="nofollow noreferrer">Joseph Goguen</a>. The longer term aim is to make sense of modal logic in RDF. For a list of academic papers on Category Theory and RDF as well as institutional theory and modal logic see <a href="https://nforum.ncatlab.org/discussion/9002/abstract-model-theory-institutions-modal-logic-contexts/" rel="nofollow noreferrer">RDF and Institution Theory (IT) message on ncatlab</a>. These papers are good at locating things in the abstract framework, but don't even get into the detail of what the RDF Models are. I just want to make sureI understand correctly what is going on by developing some simple examples.</p>
<h2>Example using RDF1.1 modelling</h2>
<p>So here is a simple example Model written out in the structure presented by the <a href="https://www.w3.org/TR/rdf11-mt/#simple-interpretations" rel="nofollow noreferrer">RDF1.1 semantic spec</a>. (As we will see a bit further below this can be made a lot easier to understand with arrow diagrams) We need a set of Resources IR, and Predicates IP,  so I chose a simple example with 6 objects in IR, 5 Properties in IP and 4 types of relations on IR</p>
<p><a href="https://i.sstatic.net/7mQfY.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/7mQfY.png" alt="Illustration of model as described by RDF 1.1 Semantics spec" /></a></p>
<p>I start with predicates in terms of colors to emphasize that we are dealing with models here. Later we move on to syntax, and so it will be natural to have names for the colored arrows. Initially we just want to say the world contains distinctions. Here the colors represents type of relations, grey {0} for is &quot;older than&quot;, dark green {1,3} for &quot;shook hands&quot;, light green {2,4} for &quot;knows&quot;, pink {5,6} for the relation relating a person to a statement written on their T-Shirt, and light blue {7,8} relating a person to their name (another literal).</p>
<h2>Making the model simpler using Triple based Graphs</h2>
<p>We have shown in a <a href="https://math.stackexchange.com/questions/2905226/what-kind-of-categorical-object-is-an-rdf-model/2905287#2905287">previous Stack Exchange question</a> that way of writing things to be isomorphic to the following definition of <span class="math-container">$RdfModel$</span></p>
<p><span class="math-container">$RdfModel = \mathscr{P}(IR \times IP \times IR)$</span></p>
<p>So that we can redraw the above diagram in the much clearer category
theoretical diagramatic style. We can justify this mathematically because Category Theory defines a <a href="https://ncatlab.org/nlab/show/quiver" rel="nofollow noreferrer">Quiver</a> - which other call a Graph, and other call a Directed Graph - as two sets A and N and two functions <span class="math-container">$domain$</span>  and <span class="math-container">$codomain$</span> such that</p>
<p><span class="math-container">$domain, codomain: A \to N$</span></p>
<p>Clearly we have these here since the first projection of <span class="math-container">$RdfModel$</span> could be thought of as the <span class="math-container">$domain$</span> and the third projection as the <span class="math-container">$codomain$</span> function. Note also that every Quiver gives rise to a free category.</p>
<p>What models add to a Quiver is that it can state that a number of arrows have the same type, which we express here by giving arrows colors.</p>
<p><a href="https://i.sstatic.net/tuHKT.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/tuHKT.png" alt="an RDF Model as explained by W3C RDF1.1 spec" /></a></p>
<p>This image of Vint Cerf shaking hands with Tim Berners-Lee should make it
more intutive, and help show why this is useful, as it helps us describe things like Tim meeting Vint.</p>
<p><a href="https://i.sstatic.net/7RYxy.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/7RYxy.png" alt="Vint Cerf And Tim Berners-Lee" /></a></p>
<p>As practical semanticist we like to have non set elements in the sets of our Models to describe practical stuff like that, and that is fine: we have a <a href="https://math.stackexchange.com/questions/2909429/is-there-a-category-set-with-ur-elements">category of Sets with Ur-elements</a> we can work with.</p>
<p>Ok, that is for an illustrated background.</p>
<h2>Simple Category of Models organised by subset inclusion</h2>
<p>Now given that any graph is a subset of <span class="math-container">$IR \times IP \times IR$</span> we can
draw up a simplified version of the relation between all such models using just the subset Partial Order that stems from such a set of subobject (Category Theory's generalisation of the notion of subsets - do we need to generalise? Who knows: it could be useful...). Because this works with powersets and these quickly explode in complexity I have limited myself to 4 elements of IR, to real objects and 2 literals, and 2 types of relations: &quot;older than&quot; and &quot;has name&quot;.</p>
<p><a href="https://i.sstatic.net/k6teO.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/k6teO.png" alt="category of subset ordered rdf models" /></a></p>
<p>In yellow above are all the models that fit the actual world. The most comprehensive such model is M7. In light blue we have different possible worlds/models (I may be able to have different shades for different incompatible possible worlds there). The biggest graph before Top N8 models worlds where Tim and Vint have the same age, worlds which presumably would require quite a lot of change to the actual one - some complex scenario involving Vint being frozen for over a decade or so before being born... In pink we have models that we don't really want to allow at all, such as model X1 which states that Tim is older than the literal &quot;Vint Cerf&quot;, or X2 where Tim is related by the name relation to Vint (but Vint Cerf is a person not a name). X3 is the union of that nonsense (are these what one would term impossible worlds?) <a href="https://www.w3.org/2001/sw/wiki/RDFS" rel="nofollow noreferrer">RDFS</a> and Description Logic Based <a href="https://www.w3.org/2001/sw/wiki/OWL" rel="nofollow noreferrer">OWL</a> vocabularies allow one to exclude those as models, but I think the basic minimal RDF framework does not.</p>
<p>We can see that moving up any arrows into a model (eg M7) is the union of the models into it, which form a logical conjunction or a categorical coproduct. Moving in the opposite direction, say looking at the opposite category we have arrows out of a model such as M7 form its logical disjunctions, or categorical products.</p>
<h2>Relating to Institution Theory</h2>
<p>This brings us to <a href="https://www.iep.utm.edu/insti-th/" rel="nofollow noreferrer">Institution Theory</a>. The few articles on <a href="https://nforum.ncatlab.org/discussion/9002/abstract-model-theory-institutions-modal-logic-contexts/" rel="nofollow noreferrer">RDF and Institution Theory (IT)</a> explain as any IT intro does that an institution consists of</p>
<ol>
<li>a category of <span class="math-container">$Sig$</span> of Signatures <span class="math-container">$\Sigma$</span>: For our example we could have a ground graph signature <span class="math-container">$\Sigma$</span> containing only a small subset of IRIs and some literals to correspond to the objects in our model. (No existential quantifiers (aka blank nodes) for example). IRIs are just the web equivalent of mathematical symbols, designed so that people can globally coin new symbols without fearing a name clash. They stand for International Resource Identifiers and are specified syntactically by <a href="https://www.rfc-editor.org/rfc/rfc3987" rel="nofollow noreferrer">RFC3987</a>. IRI ⊇ URI ⊇ URL ∪ URN</li>
<li>a functor <span class="math-container">$Mod$</span> from <span class="math-container">$Sig^{op}$</span> to <span class="math-container">$Cat$</span> the category of categories selecting for each object in the category <span class="math-container">$\vert Sig \vert$</span> a category of models. So I guess that a signature with 4 IRIs and 2 literals can give us a signature to the category of Partially ordered models I drew above.</li>
<li>a functor <span class="math-container">$Sen$</span> from <span class="math-container">$Sig$</span> to sets of Sentences in <span class="math-container">$Set$</span> (here we need no ur-elements I think, since we can encode the Unicode alphabet with the empty set and sets thereof)</li>
<li>A relation <span class="math-container">$\models_\Sigma \space \subseteq \vert Mod(\Sigma) \vert \times Sen(\Sigma)$</span></li>
</ol>
<p>But those papers don't really tell me what such a category of models is. So that's what I am trying to make sure I have understood correctly with the simple example given above.</p>
<p>Now, IT does not state what their set of sentences look like. RDF has so many different syntaxes (RDF/XML, NTriples, Turtle, JSON-LD, ...) to cater to the different (at times religious) fashions that it would be silly to put real syntactic sentences there. Better have sets of <a href="https://www.w3.org/TR/rdf11-concepts/" rel="nofollow noreferrer">Abstract Syntax Graphs</a> as our sentences. As it happens those look very much like our models. If we can distinguish just IRIs and Literals types as defined by IETF and W3C, and just define the type</p>
<p><span class="math-container">$GNode = IRI+Literal$</span></p>
<p>We may want to specialise this to a signature <span class="math-container">$\Sigma$</span> which only contains a subset of IRIs and Literals needed for a model (as the RDF1.1 Semantic web syntax hints at in <a href="https://www.w3.org/TR/rdf11-mt/#finite-interpretations-informative" rel="nofollow noreferrer">Appendix B: Finite Interpretations</a>). So we could have <span class="math-container">$\Sigma_{IRI}$</span> to refer to the set of IRIs used by that signature, <span class="math-container">$\Sigma_{Literal}$</span> to refer to the set of Literals used by that signature and <span class="math-container">$\Sigma_{GNode}$</span> to refer the disjoint union of the IRIs and Literals of that signature.</p>
<p>Then we can define the type of (syntactic) RdfGraph for a signature as</p>
<p><span class="math-container">$Sen(\Sigma) = \mathscr{P}(\Sigma_{GNode} \times \Sigma_{IRI} \times \Sigma_{GNode}) $</span></p>
<p>which clearly is a subcategory of our Models. It would be interesting to regard that indeed as a category, in which case we could get from those to the Set required by Institution Theory by selecting the set of objects <span class="math-container">$|Sen(\Sigma)|$</span> of our signature.</p>
<p>So now I suppose if G7 is the top yellow model in the model Poset category above then given that
<span class="math-container">$ ":" : IRIRef \times String \to IRIRef$</span></p>
<p>is the append operation on the string component of a IRIRef, and we have defined the strings</p>
<pre><code>foaf = &lt;http://xmlns.com/foaf/0.1/&gt;
timbl = &lt;https://www.w3.org/People/Berners-Lee/card#i&gt;
</code></pre>
<p>where surrounding a string with angle brackets turns it into a IRI reference (as opposed to a literal string)</p>
<p><span class="math-container">$ G7 \models \text { { timbl  foaf:name "Tim Berners-Lee" . }}$</span></p>
<p>but so does the top green model <span class="math-container">$J7$</span> where Tim and Vint have the same age</p>
<p><span class="math-container">$ J7 \models \text { { timbl  foaf:name "Tim Berners-Lee" . }}$</span></p>
<p>So I guess now that the category which is the range of the <span class="math-container">$Mod$</span> functor - which remember maps each signature <span class="math-container">$\Sigma$</span> to a category of models - must be a category with growing number of objects in IR and PR, up to something like infinity. The morphisms in this category would relate one poset category to the next, in a way that is faithful to the poset structure in some way - presumably by keeping the same types of distinctions. (I am not quite sure what this is yet)</p>

<lo.logic><ct.category-theory><semantics><db.databases><modal-logic>
What does the category of RDF models look like in Institution Theory?
Henry Story
# What does the category of RDF models look like in Institution Theory?

(Asked by: username_0 on 2018-09-19)

The Question in short
Here is the question in its pure form. Details of my reasoning can be found below.
The RDF1.1 spec semantics defines a model to consist of a set IR of objects and IP of predicates. The way they define a Model is Isomorphic to the following type definition.
$RDFModel = \mathscr{P}(IR \times IP \times IR)$
Note that any Model is thus a Quiver as can be seen by noticing that for any $M: RDFModel$ the first and third projections give us the functions we need:
$ \pi_1, \pi_3: M \to IR$
so that the graph representation of a model below is justified.
Anyway since RDFModel is a powerset one can look at it as a poset category where the element Models built from a set of Resources R and Predicates P are the objects, and the morphisms are the subset relations. Call this category $\Bbb{M}_{RP}$
Questions:

Is such a Poset category $\Bbb{M}_{RP}$ what an RDF Institution would send a Signature $\Sigma$ to? Ie is this the right type $ Mod(\Sigma): \Bbb{M}_{RP}$ ?
Since there can be many such categories of different sizes depending on IP and IR (Appendix B: Finite Interpretations), it is likely that these categories of poset can form a category which we could call $\Bbb{M}$. (Somewhat like the category of boolean algebras). Is that the category that the functor $Mod$ has as range? Ie. $Mod: Sig^{op} \to \Bbb{M}$
In the category $\Bbb{M}$ what is the smallest category (initial or final object?)
Any category $\Bbb{M}$ contains many models so for any such model some sentences will be satisfied others not. In modal logics those are thought of as possible worlds. But in David Lewis' sense those are complete objects. It looks like possible worlds must be fixed points - or final objects - in a category of models of ever increasing size. Is there a way to capture these purely category theoretically? (Also can one call those mini models possible worlds?)
Is there a way to state how the open world assumption works in this context?

Context of the Question
The RDF1.1 semantic spec comes with a simple model discussed in a previous Stack Exchange question. The aim of this question is to see how that can be brought into the larger space of Category Theoretical Institutional Theory started by the famous computer scientist Joseph Goguen. The longer term aim is to make sense of modal logic in RDF. For a list of academic papers on Category Theory and RDF as well as institutional theory and modal logic see RDF and Institution Theory (IT) message on ncatlab. These papers are good at locating things in the abstract framework, but don't even get into the detail of what the RDF Models are. I just want to make sureI understand correctly what is going on by developing some simple examples.
Example using RDF1.1 modelling
So here is a simple example Model written out in the structure presented by the RDF1.1 semantic spec. (As we will see a bit further below this can be made a lot easier to understand with arrow diagrams) We need a set of Resources IR, and Predicates IP,  so I chose a simple example with 6 objects in IR, 5 Properties in IP and 4 types of relations on IR

I start with predicates in terms of colors to emphasize that we are dealing with models here. Later we move on to syntax, and so it will be natural to have names for the colored arrows. Initially we just want to say the world contains distinctions. Here the colors represents type of relations, grey {0} for is "older than", dark green {1,3} for "shook hands", light green {2,4} for "knows", pink {5,6} for the relation relating a person to a statement written on their T-Shirt, and light blue {7,8} relating a person to their name (another literal).
Making the model simpler using Triple based Graphs
We have shown in a previous Stack Exchange question that way of writing things to be isomorphic to the following definition of $RdfModel$
$RdfModel = \mathscr{P}(IR \times IP \times IR)$
So that we can redraw the above diagram in the much clearer category
theoretical diagramatic style. We can justify this mathematically because Category Theory defines a Quiver - which other call a Graph, and other call a Directed Graph - as two sets A and N and two functions $domain$  and $codomain$ such that
$domain, codomain: A \to N$
Clearly we have these here since the first projection of $RdfModel$ could be thought of as the $domain$ and the third projection as the $codomain$ function. Note also that every Quiver gives rise to a free category.
What models add to a Quiver is that it can state that a number of arrows have the same type, which we express here by giving arrows colors.

This image of Vint Cerf shaking hands with Tim Berners-Lee should make it
more intutive, and help show why this is useful, as it helps us describe things like Tim meeting Vint.

As practical semanticist we like to have non set elements in the sets of our Models to describe practical stuff like that, and that is fine: we have a category of Sets with Ur-elements we can work with.
Ok, that is for an illustrated background.
Simple Category of Models organised by subset inclusion
Now given that any graph is a subset of $IR \times IP \times IR$ we can
draw up a simplified version of the relation between all such models using just the subset Partial Order that stems from such a set of subobject (Category Theory's generalisation of the notion of subsets - do we need to generalise? Who knows: it could be useful...). Because this works with powersets and these quickly explode in complexity I have limited myself to 4 elements of IR, to real objects and 2 literals, and 2 types of relations: "older than" and "has name".

In yellow above are all the models that fit the actual world. The most comprehensive such model is M7. In light blue we have different possible worlds/models (I may be able to have different shades for different incompatible possible worlds there). The biggest graph before Top N8 models worlds where Tim and Vint have the same age, worlds which presumably would require quite a lot of change to the actual one - some complex scenario involving Vint being frozen for over a decade or so before being born... In pink we have models that we don't really want to allow at all, such as model X1 which states that Tim is older than the literal "Vint Cerf", or X2 where Tim is related by the name relation to Vint (but Vint Cerf is a person not a name). X3 is the union of that nonsense (are these what one would term impossible worlds?) RDFS and Description Logic Based OWL vocabularies allow one to exclude those as models, but I think the basic minimal RDF framework does not.
We can see that moving up any arrows into a model (eg M7) is the union of the models into it, which form a logical conjunction or a categorical coproduct. Moving in the opposite direction, say looking at the opposite category we have arrows out of a model such as M7 form its logical disjunctions, or categorical products.
Relating to Institution Theory
This brings us to Institution Theory. The few articles on RDF and Institution Theory (IT) explain as any IT intro does that an institution consists of

a category of $Sig$ of Signatures $\Sigma$: For our example we could have a ground graph signature $\Sigma$ containing only a small subset of IRIs and some literals to correspond to the objects in our model. (No existential quantifiers (aka blank nodes) for example). IRIs are just the web equivalent of mathematical symbols, designed so that people can globally coin new symbols without fearing a name clash. They stand for International Resource Identifiers and are specified syntactically by RFC3987. IRI ⊇ URI ⊇ URL ∪ URN
a functor $Mod$ from $Sig^{op}$ to $Cat$ the category of categories selecting for each object in the category $\vert Sig \vert$ a category of models. So I guess that a signature with 4 IRIs and 2 literals can give us a signature to the category of Partially ordered models I drew above.
a functor $Sen$ from $Sig$ to sets of Sentences in $Set$ (here we need no ur-elements I think, since we can encode the Unicode alphabet with the empty set and sets thereof)
A relation $\models_\Sigma \space \subseteq \vert Mod(\Sigma) \vert \times Sen(\Sigma)$

But those papers don't really tell me what such a category of models is. So that's what I am trying to make sure I have understood correctly with the simple example given above.
Now, IT does not state what their set of sentences look like. RDF has so many different syntaxes (RDF/XML, NTriples, Turtle, JSON-LD, ...) to cater to the different (at times religious) fashions that it would be silly to put real syntactic sentences there. Better have sets of Abstract Syntax Graphs as our sentences. As it happens those look very much like our models. If we can distinguish just IRIs and Literals types as defined by IETF and W3C, and just define the type
$GNode = IRI+Literal$
We may want to specialise this to a signature $\Sigma$ which only contains a subset of IRIs and Literals needed for a model (as the RDF1.1 Semantic web syntax hints at in Appendix B: Finite Interpretations). So we could have $\Sigma_{IRI}$ to refer to the set of IRIs used by that signature, $\Sigma_{Literal}$ to refer to the set of Literals used by that signature and $\Sigma_{GNode}$ to refer the disjoint union of the IRIs and Literals of that signature.
Then we can define the type of (syntactic) RdfGraph for a signature as
$Sen(\Sigma) = \mathscr{P}(\Sigma_{GNode} \times \Sigma_{IRI} \times \Sigma_{GNode}) $
which clearly is a subcategory of our Models. It would be interesting to regard that indeed as a category, in which case we could get from those to the Set required by Institution Theory by selecting the set of objects $|Sen(\Sigma)|$ of our signature.
So now I suppose if G7 is the top yellow model in the model Poset category above then given that
$ ":" : IRIRef \times String \to IRIRef$
is the append operation on the string component of a IRIRef, and we have defined the strings
foaf = 
timbl = 

where surrounding a string with angle brackets turns it into a IRI reference (as opposed to a literal string)
$ G7 \models \text { { timbl  foaf:name "Tim Berners-Lee" . }}$
but so does the top green model $J7$ where Tim and Vint have the same age
$ J7 \models \text { { timbl  foaf:name "Tim Berners-Lee" . }}$
So I guess now that the category which is the range of the $Mod$ functor - which remember maps each signature $\Sigma$ to a category of models - must be a category with growing number of objects in IR and PR, up to something like infinity. The morphisms in this category would relate one poset category to the next, in a way that is faithful to the poset structure in some way - presumably by keeping the same types of distinctions. (I am not quite sure what this is yet)

**Tags:** lo.logic, ct.category-theory, semantics, db.databases, modal-logic


---

## 2 answers

### Answer by username_1 on 2018-09-24. Score: 3 | Accepted answer

There's a lot to unpack here and I don't know about Goguen's institutions. But perhaps I can give a partial answer to your question.

Let's start with ["simple interpretations"](https://www.w3.org/TR/rdf11-mt/#simple-interpretations) of RDF, as defined by the spec, forgetting about richer languages like RDFS or OWL. If we ignore IRIs and literals, as in the first part of your question, then an RDF model is a simple object: an edge-labeled graph, whose vertices are resources, edges are triples, and edge labels are predicates.

To view RDF models as a category of models, we can use a variation of the *graph indexing category*, as discussed, for example, in David Spivak's book on [category theory for the sciences](https://arxiv.org/abs/1302.6946). Define a category $\mathbf{RDF}\_0$ with three objects $T$, $R$, and $P$, representing the triples, resources, and properties, and three morphisms $subj: T \to R$, $pred: T \to P$, $obj: T \to R$, representing the subject, predicate, and object of a triple. An *RDF model* is a functor $M: \mathbf{RDF}\_0 \to \mathbf{Set}$. There is a functor category of all such models, whose morphisms are natural transformations. Under this definition, a morphism of RDF models is just a label-preserving graph homomorphism.

IRIs and literal can be incorporated within this general approach. Define a new category $\mathbf{RDF}$ consisting of the objects and morphisms of $\mathbf{RDF}\_0$, plus two additional objects $IRI$ and $L$, representing the IRIs and literals, and two additional morphisms $iri: IRI \to R + P$ and $lit: L \to R$, representing interpretations of the IRIs and literals as resources and/or properties. Here the sum of objects ($+$) is a coproduct (disjoint union). We can handle the sum in multiple ways. We can say that $\mathbf{RDF}$ is the free cocartesian category generated by the above objects and morphisms. Or we can think of $\mathbf{RDF}$ as a [sketch](https://ncatlab.org/nlab/show/sketch).

On this definition, an *RDF model*, as defined by the "simple interpretations" of the RDF 1.0 spec, is a (coproduct-preserving) functor $M: \mathbf{RDF} \to \mathbf{Set}$. As before, morphisms of RDF models are natural transformations between such functors.

That's all I have time to say right now. If you're interested, I can describe a different way of thinking about this problem that lends itself better to richer systems like RDFS or OWL.

> **Comments:**
> **username_0**: The notion of a sketch has come up before in this context, and I need to study your answer more carefully, which will take a bit of time. But it is very helpful to have such criss crossing views on a topic. I'd be interested to see what you think would be a more appropriate model for RDFS and OWL. Institution Independent Model Theory helps for example show that blank nodes can be explained by a morphism from a literal+IRI signature Σ to a Σ+X where X stand for blank nodes. Any such morphism :  Σ → Σ+X is a blank node instantiation. That helps explain bnodes in one simple move.  
> **username_0**: does [my answer](https://cstheory.stackexchange.com/a/41670/50651) look like it is isomorphic to yours, @EvanPatterson ?  
> **username_0**: I also found the paper by Spivak "Functorial Data Migration" https://www.sciencedirect.com/science/article/pii/S0890540112001010  very helpful and clear. It turns out that RDF there is a Grothendieck Construction from a Database Instance which is a funtor from a small category to set.  
> **username_0**: Ah I found your paper "Knowledge Representation in Bicategories of Relations" which mentions OWL.  

---

### Answer by username_0 on 2018-10-01. Score: 0

My supervisor thought the problem with the above view of the model from the IT point of view is that it forgets the interpretation part in the range of the Mod functor. Indeed the above definition of Mod takes a signature to a category of pure models. But if one thinks of things this way then one would end up with an Institution being much closer to what David Lewis called a language or indeed we call a language: that is a particular assignment of words/sentences to meanings via a grammar.

If we look at the definition of the Bare RDF Institution BRDF in the article “[Semantic web languages–towards an institutional perspective](http://citeseerx.ist.psu.edu/viewdoc/download?doi=10.1.1.119.5368&rep=rep1&type=pdf)” [1] we indeed find the following definition for a signature $\Sigma$ consisting just of a set $RR$ of resource references

> $RR$-models I are tuples $I = (R\_I, P\_I, S\_I, ext\_I)$, where $R\_I$ is a set of resources, $P\_I$ is a subset of $R\_I (P\_I ⊆ R\_I)$ - the set of properties, $S\_I : RR → R\_I$ is a mapping function that maps each resource reference to some resource, and $ext\_I : P\_I → \mathscr{P}(R\_I × R\_I)$ is an extension function mapping each property to a set of pairs of resources that it relates.

Clearly their use of I suggests they were also thinking in terms of an interpretation, not a model. We can rearrange that structure to $I = (S\_I, (R\_I, P\_I, ext\_I))$ or even more concisely to $I = (S\_I,M\_I)$ where $S\_I: RR \to R\_I$ is the semantic function, and $M\_I ⊆ R\_I \times P\_I \times R\_I$ is our model of triples.

If that is correct then the name Mod in institution theory is a bad name for a such a functor, as it suggests a model, and that can be used as say David Lewis would to mean a possible world for example, or sets of those, One would then expect there to many functors from a signature to a model, one for each language, whereas we actually have one mapping from a signature to a category of interpretations. Calling such a Functor $Int$ would be more intutive, but that clashes with the wide useage for integers in computing. So I thought one may want to use the ☿ symbol for Mercury the Roman version of the greek god Hermes, the god of interpretation. The discussion on that subtopic could continue [on ncatlab institution entry](https://nforum.ncatlab.org/discussion/9012/institution/)

[1] Lucanu, Dorel, Yuan Fang Li, and Jin Song Dong.
“Semantic web languages–towards an institutional perspective.”
Algebra, Meaning, and Computation. Springer, Berlin, Heidelberg, 2006. 99-123.


---

