Changes between Version 4 and Version 5 of FrequentlyAskedQuestions
- Timestamp:
- 02/03/2010 17:28:03 (6 months ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
FrequentlyAskedQuestions
v4 v5 16 16 17 17 {{{ 18 #! html18 #!xm 19 19 <% if current_user.guest? %> 20 20 <p>Guests may not access this data</p> … … 81 81 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) 82 82 83 == How do i get all the supertypes of a source? == 83 == How do i get all the supertypes of a source? == 84 85 The #types method of a source will return an array of [http://net7.github.com/semantic_naming/classes/N/SourceClass.html SourceClass] objects, each of which you can ask for their supertypes: 86 87 {{{ 88 #!ruby 89 supertypes = [] 90 source.types.each { |tp| supertypes += tp.superty} 91 supertypes.uniq! 92 }}} 93 94 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: 95 96 {{{ 97 #!ruby 98 supertypes = ActiveRDF::Query.new(N::SourceClass).select(:superclass).where(source, N::RDF.type, :type).where(:type, N::RDFS.subClassOf, :superclass).execute 99 }}} 84 100 85 101 == How do i get all the incoming properties of a source? == 102 == How do i get all the outgoing properties of a source? == 86 103 87 == How do i get all the outgoing properties of a source? == 104 You can just use the #direct_predicates and #inverse_predicates methods on a source object. 105 106 {{{ 107 #!ruby 108 source.direct_predicates 109 => [pred1, pred2] 110 source.inverse_predicates 111 => [pred1, pred2] 112 }}} 88 113 89 114 == How do i "unpublish" a source? == 90 115 116 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. 117 118 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. 119 91 120 == How do I add another data object to a source? == 92 121 122 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: 123 124 {{{ 125 #!ruby 126 xml_data = TaliaCore::DataTypes::XmlData.new 127 xml_data.create_from_file('xml_file', path_to_xml_file) 128 source.data_records << xml_data 129 }}} 130 131 See the [http://net7.github.com/talia_core/ documentation] to find out how data records can be created and which data types exist in Talia. 132 93 133 == How do I get a hash of a source? == 134 == Does the hash change when I modify/add/remove the properties of a source or its data objects? == 94 135 95 == Does the hash change when I modify/add/remove the properties of a source or its data objects? == 136 Talia doesn't provide a special facility to compute hash values for a given source.
