Frequently Asked Questions
Why a source has multiple types?
This is a property of the "semantic data" thing in Talia (see the TaliaTutorial for an introduction on that). In a nutshell, it allows you to capture various aspects of a Source: A "Person" can also be an "Author" of a book or a "Character" in it.
Usually this shouldn't cause any problems for you, and you'll not have to explicitly deal with this feature until you need it - and then it'll come quite handy.
How do I define from which property the timeline takes the values?
To find out how to use the time line, first consult the TaliaTutorial. The time line has a whole lot of options: You can supply the data directly, take it from an existing collection of sources or have it look up the sources itself. Check out the documentation at muruca widgets, in particular for the TimelineSource class.
How do I restrict the visibility of some sources to a particular group of users?
In future versions of Talia we may provide you with a full-featured role-management. As for now, you can check if a user is a guest, a logged in user or an administrator. To restrict some sources to one of this groups, you can make a semantic template for that group (see the TaliaTutorial) and use a conditional block like this:
<% if current_user.guest? %> <p>Guests may not access this data</p> <% else %> ... your source template ... <% end %>
Valid possibilities for the current_user are guest? and administrator?
How do I choose which properties of go into which fields of the OAI interface?
Talia contains a basic OAI-PMH implementation. The Talia OAI will serve the basic DublinCore metadata, as required by the OAI specification. If you filled the default DublinCore? properties in your data, they will automatically be available from the OAI.
Supporting other OAI formats, or creating a generic field mapping is possible, but may require some programming work.
How do I create a collection?
How do I put a source into a collection?
How do I define the order of sources in a collection?
We're in the process of revamping the Talia backend to make it possible to create collections from the backend interface without much effort. You can already make "compatible" collections in your data import file by creating sources with the type "TaliaCore::Collection" and using the "dct:isPartOf" relation to connect the members to the collection.
<example> Example import xml here? </example>
Do collections get exported as "sets" in the OAI interface?
At the moment: No. If such a feature is requested, we may implement it in the future.
How do I know if a URI belongs to a source?
A source in Talia can have any possible URI. If you want to check if a given source exists in the data store, use the following code:
TaliaCore::ActiveSource.exist?(uri)
How do I know if a URI belongs to a local source?
A source is "local" in Talia if it is in the "local" namespace (configured in the talia_core.yml configuration file). The URI class that is used in Talia can check if a given URI is local. If you want to check a string. URI-containing objects in Talia, like strings and sources, will support a #to_uri method. Thus, you can easily test like this:
object.to_uri.local? # Works on objects of type string, source: "http://foobar.com".to_uri.local?
How do I know if a uri belongs to a class of one of the ontologies stored in the local rdf store?
You can get all the RDF types from a source by calling
source.types => [type1, type1]
However, those types may or may not be in the ontologies in the local rdf store. To find this, you can do a direct RDF query:
ActiveRDF::Query.new(TaliaCore::ActiveSource).select(:source).where(:source, N::RDF.type, :type).where(:type, N::RDF.type, N::RDFS.Class)
This will return all sources that have an rdf type which in turn is a "Class" (which means that it was defined in an ontology)
How do i get all the supertypes of a source?
The #types method of a source will return an array of SourceClass objects, each of which you can ask for their supertypes:
supertypes = [] source.types.each { |tp| supertypes += tp.superty} supertypes.uniq!
This method isn't very efficient, though. You may want to check if the N::SourceClass?.subclass_hierarchy method will help you out, or use a custom RDF query like this:
supertypes = ActiveRDF::Query.new(N::SourceClass).select(:superclass).where(source, N::RDF.type, :type).where(:type, N::RDFS.subClassOf, :superclass).execute
How do i get all the incoming properties of a source?
How do i get all the outgoing properties of a source?
You can just use the #direct_predicates and #inverse_predicates methods on a source object.
source.direct_predicates => [pred1, pred2] source.inverse_predicates => [pred1, pred2]
How do i "unpublish" a source?
In general we do not recommend delete data from the web after it has been published, as other people may already link to it. If you just want to rebuild your datastore from a clean slate, try importing your data again with the reset_store option.
That said, you may use #delete or #destroy on source objects. This feature is still a bit experimental and may not always remove all traces of the source, though.
How do I add another data object to a source?
You may add any number of data objects to a source. You can add data objects through the data import facility (even multiple ones) or during incremental imports. To add them programmatically, you need to do something like this:
xml_data = TaliaCore::DataTypes::XmlData.new xml_data.create_from_file('xml_file', path_to_xml_file) source.data_records << xml_data
See the documentation to find out how data records can be created and which data types exist in Talia.
How do I get a hash of a source?
Does the hash change when I modify/add/remove the properties of a source or its data objects?
Talia doesn't provide a special facility to compute hash values for a given source.
How do I delete all notebooks published with SwikyNotes?
cd yourtaliadir jruby script/console >> Swicky::Notebook.find_all => [#<Swicky::Notebook:0x2f49f848 @url=#<N::URI:0x594b7042 @uri_s="http://localhost:5000/users/admin/swicky_notebooks/michelesthirdnotebook">>] >> Swicky::Notebook.find_all.each{|notebook| notebook.delete}
How do I order sources by title in the sources controller's index action?
How do I get the local URL of a source? (it may be different to its URI)
@source.to_uri.local_name
How can i use script/server and script/console at the same time while developing?
You need to install the Sesame RDF store as a server instead as a library. This allows concurrent access to the RDF store, see http://www.openrdf.org/doc/sesame/users/ch02.html#d0e230. To use Sesame as a server you must deploy it in a java application server, like tomcat or glassfish.
Download the package, extract it, and deploy the two files
war/openrdf-sesame.war war/openrdf-workbench.war
For example, for glassfish you have to go on http://localhost:4848/asadmin and create two new web applications. Let's say the 2 contexts are /sesame and /workbench.
Go on http://localhost:8080/workbench/ and create one (or more) repository, for example "sesame_dev". It's location will be something very similar to "http://localhost:8080/sesame/repositories/sesame_dev". Use it to setup your config/rdfstore.yml, which has to look like:
development: type: sesame url: http://localhost:8080/sesame/repositories/sesame_dev backend: http
Finally, you will have to re-import your data.
